From e962113c63e8ef567b82d19484d05cbc8ae3685c Mon Sep 17 00:00:00 2001 From: Teja Mupparti Date: Wed, 10 Aug 2022 11:42:35 -0700 Subject: [PATCH] Remove the GUC mention in the error message as this config is meant for advanced users --- .../distributed/commands/create_distributed_table.c | 8 +++----- src/backend/distributed/shared_library_init.c | 2 +- src/test/regress/expected/citus_table_triggers.out | 4 ++-- .../regress/expected/create_ref_dist_from_citus_local.out | 2 +- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/backend/distributed/commands/create_distributed_table.c b/src/backend/distributed/commands/create_distributed_table.c index 269a315ae..f7cff4197 100644 --- a/src/backend/distributed/commands/create_distributed_table.c +++ b/src/backend/distributed/commands/create_distributed_table.c @@ -1352,11 +1352,9 @@ EnsureRelationHasNoTriggers(Oid relationId) char *relationName = get_rel_name(relationId); Assert(relationName != NULL); - ereport(ERROR, (errmsg("cannot distribute relation \"%s\" because it has " - "triggers and \"citus.enable_unsafe_triggers\" is " - "set to \"false\"", relationName), - errhint("Consider setting \"citus.enable_unsafe_triggers\" " - "to \"true\", or drop all the triggers on \"%s\" " + ereport(ERROR, (errmsg("cannot distribute relation \"%s\" because it " + "has triggers", relationName), + errhint("Consider dropping all the triggers on \"%s\" " "and retry.", relationName))); } } diff --git a/src/backend/distributed/shared_library_init.c b/src/backend/distributed/shared_library_init.c index 7c04f9088..1d00ccf5c 100644 --- a/src/backend/distributed/shared_library_init.c +++ b/src/backend/distributed/shared_library_init.c @@ -1171,7 +1171,7 @@ RegisterCitusConfigVariables(void) &EnableUnsafeTriggers, false, PGC_USERSET, - GUC_STANDARD, + GUC_STANDARD | GUC_NO_SHOW_ALL, NULL, NULL, NULL); DefineCustomBoolVariable( diff --git a/src/test/regress/expected/citus_table_triggers.out b/src/test/regress/expected/citus_table_triggers.out index e5d14b69e..bc61e863b 100644 --- a/src/test/regress/expected/citus_table_triggers.out +++ b/src/test/regress/expected/citus_table_triggers.out @@ -106,9 +106,9 @@ AFTER INSERT ON reference_table_1 FOR EACH ROW EXECUTE FUNCTION update_value(); -- below two should fail SELECT create_distributed_table('distributed_table_1', 'value'); -ERROR: cannot distribute relation "distributed_table_1" because it has triggers and "citus.enable_unsafe_triggers" is set to "false" +ERROR: cannot distribute relation "distributed_table_1" because it has triggers SELECT create_reference_table('reference_table_1'); -ERROR: cannot distribute relation "reference_table_1" because it has triggers and "citus.enable_unsafe_triggers" is set to "false" +ERROR: cannot distribute relation "reference_table_1" because it has triggers --------------------------------------------------------------------- -- test deparse logic for CREATE TRIGGER commands -- via master_get_table_ddl_events diff --git a/src/test/regress/expected/create_ref_dist_from_citus_local.out b/src/test/regress/expected/create_ref_dist_from_citus_local.out index 14fffed22..7f6821b1f 100644 --- a/src/test/regress/expected/create_ref_dist_from_citus_local.out +++ b/src/test/regress/expected/create_ref_dist_from_citus_local.out @@ -346,7 +346,7 @@ BEGIN; FOR EACH ROW EXECUTE PROCEDURE update_value(); -- show that we error out as we don't supprt triggers on distributed tables SELECT create_distributed_table('citus_local_table_6', 'col_1'); -ERROR: cannot distribute relation "citus_local_table_6" because it has triggers and "citus.enable_unsafe_triggers" is set to "false" +ERROR: cannot distribute relation "citus_local_table_6" because it has triggers ROLLBACK; -- make sure that creating append / range distributed tables is also ok BEGIN;