Make merge tables during re-partitioning unlogged

pull/3539/head
Marco Slot 2020-02-26 08:51:11 +01:00
parent 5d601bb45a
commit c7f123947e
1 changed files with 4 additions and 5 deletions

View File

@ -464,12 +464,11 @@ CreateTaskTable(StringInfo schemaName, StringInfo relationName,
Assert(schemaName != NULL); Assert(schemaName != NULL);
Assert(relationName != NULL); Assert(relationName != NULL);
/*
* This new relation doesn't log to WAL, as the table creation and data copy
* statements occur in the same transaction. Still, we want to make the
* relation unlogged once we upgrade to PostgreSQL 9.1.
*/
RangeVar *relation = makeRangeVar(schemaName->data, relationName->data, -1); RangeVar *relation = makeRangeVar(schemaName->data, relationName->data, -1);
/* this table will only exist for the duration of the query, avoid writing to WAL */
relation->relpersistence = RELPERSISTENCE_UNLOGGED;
List *columnDefinitionList = ColumnDefinitionList(columnNameList, columnTypeList); List *columnDefinitionList = ColumnDefinitionList(columnNameList, columnTypeList);
CreateStmt *createStatement = CreateStatement(relation, columnDefinitionList); CreateStmt *createStatement = CreateStatement(relation, columnDefinitionList);