Commit a9eeac9c authored by Steven Murray's avatar Steven Murray
Browse files

PostgresCatalogue::beginCreateTemporarySetDeferred() no longer calls Conn::executeNonQueries()

parent d9db5b96
......@@ -894,27 +894,15 @@ void PostgresCatalogue::deleteArchiveFile(const std::string &diskInstanceName, c
// beginCreateTemporarySetDeferred
//------------------------------------------------------------------------------
void PostgresCatalogue::beginCreateTemporarySetDeferred(rdbms::Conn &conn) const {
const char *const sql_temptables =
"BEGIN;"
"CREATE TEMPORARY TABLE TEMP_ARCHIVE_FILE_BATCH ("
"LIKE ARCHIVE_FILE) "
"ON COMMIT DROP;"
"ALTER TABLE TEMP_ARCHIVE_FILE_BATCH "
"ADD COLUMN STORAGE_CLASS_NAME VARCHAR(100);"
"ALTER TABLE TEMP_ARCHIVE_FILE_BATCH "
"ALTER COLUMN STORAGE_CLASS_ID DROP NOT NULL;"
"CREATE INDEX TEMP_A_F_B_ARCHIVE_FILE_ID_I ON "
"TEMP_ARCHIVE_FILE_BATCH(ARCHIVE_FILE_ID);"
"CREATE INDEX TEMP_A_F_B_DIN_SCN_I ON "
"TEMP_ARCHIVE_FILE_BATCH(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME);"
"CREATE TEMPORARY TABLE TEMP_TAPE_FILE_BATCH("
"ARCHIVE_FILE_ID NUMERIC(20,0)) "
"ON COMMIT DROP;"
"CREATE INDEX TEMP_T_F_B_ARCHIVE_FILE_ID_I ON "
"TEMP_TAPE_FILE_BATCH(ARCHIVE_FILE_ID);"
"SET CONSTRAINTS ARCHIVE_FILE_DIN_DFI_UN DEFERRED";
conn.executeNonQueries(sql_temptables);
conn.executeNonQuery("BEGIN");
conn.executeNonQuery("CREATE TEMPORARY TABLE TEMP_ARCHIVE_FILE_BATCH (LIKE ARCHIVE_FILE) ON COMMIT DROP");
conn.executeNonQuery("ALTER TABLE TEMP_ARCHIVE_FILE_BATCH ADD COLUMN STORAGE_CLASS_NAME VARCHAR(100)");
conn.executeNonQuery("ALTER TABLE TEMP_ARCHIVE_FILE_BATCH ALTER COLUMN STORAGE_CLASS_ID DROP NOT NULL");
conn.executeNonQuery("CREATE INDEX TEMP_A_F_B_ARCHIVE_FILE_ID_I ON TEMP_ARCHIVE_FILE_BATCH(ARCHIVE_FILE_ID)");
conn.executeNonQuery("CREATE INDEX TEMP_A_F_B_DIN_SCN_I ON TEMP_ARCHIVE_FILE_BATCH(DISK_INSTANCE_NAME, STORAGE_CLASS_NAME)");
conn.executeNonQuery("CREATE TEMPORARY TABLE TEMP_TAPE_FILE_BATCH(ARCHIVE_FILE_ID NUMERIC(20,0)) ON COMMIT DROP");
conn.executeNonQuery("CREATE INDEX TEMP_T_F_B_ARCHIVE_FILE_ID_I ON TEMP_TAPE_FILE_BATCH(ARCHIVE_FILE_ID)");
conn.executeNonQuery("SET CONSTRAINTS ARCHIVE_FILE_DIN_DFI_UN DEFERRED");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment