Skip to content

Commit a8ae188

Browse files
committed
hide NOTICE messages using GUC magic
1 parent ee9ccbc commit a8ae188

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/partition_creation.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,15 @@ create_table_using_stmt(CreateStmt *create_stmt, Oid relowner)
668668
ObjectAddress table_addr;
669669
Datum toast_options;
670670
static char *validnsps[] = HEAP_RELOPT_NAMESPACES;
671+
int guc_level;
672+
673+
/* Create new GUC level... */
674+
guc_level = NewGUCNestLevel();
675+
676+
/* ... and set client_min_messages = WARNING */
677+
(void) set_config_option("client_min_messages", "WARNING",
678+
PGC_USERSET, PGC_S_SESSION,
679+
GUC_ACTION_SAVE, true, 0, false);
671680

672681
/* Create new partition owned by parent's posessor */
673682
table_addr = DefineRelation(create_stmt, RELKIND_RELATION, relowner, NULL);
@@ -693,6 +702,9 @@ create_table_using_stmt(CreateStmt *create_stmt, Oid relowner)
693702
/* Now create the toast table if needed */
694703
NewRelationCreateToastTable(table_addr.objectId, toast_options);
695704

705+
/* Restore original GUC values */
706+
AtEOXact_GUC(true, guc_level);
707+
696708
/* Return the address */
697709
return table_addr;
698710
}

0 commit comments

Comments
 (0)