From 2beb87297e96171ba5071a185bb0890b87001d83 Mon Sep 17 00:00:00 2001 From: Minghui Yang Date: Tue, 17 Sep 2024 18:42:57 +0000 Subject: [PATCH] [#23786] YSQL: add yb_make_next_ddl_statement_nonincrementing to YbDbAdminVariables Summary: The yb_make_next_ddl_statement_nonincrementing has PGC_SUSET and needs to be added to YbDbAdminVariables in order for yb_db_admin role to set it. Otherwise, we see permission denied error for yb_db_admin: ``` yugabyte=# set role yb_db_admin; SET yugabyte=> set yb_make_next_ddl_statement_nonincrementing to true; ERROR: permission denied to set parameter "yb_make_next_ddl_statement_nonincrementing" ``` I added yb_make_next_ddl_statement_nonincrementing to YbDbAdminVariables, and the above error is gone ``` yugabyte=# set role yb_db_admin; SET yugabyte=> set yb_make_next_ddl_statement_nonincrementing to true; SET ``` Jira: DB-12689 Test Plan: ./yb_build.sh --cxx-test pg_catalog_version-test --gtest_filter PgCatalogVersionTest.NonIncrementingDDLMode Reviewers: kfranz Reviewed By: kfranz Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D38135 --- src/postgres/src/backend/utils/misc/guc.c | 1 + src/yb/yql/pgwrapper/pg_catalog_version-test.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/src/postgres/src/backend/utils/misc/guc.c b/src/postgres/src/backend/utils/misc/guc.c index bd0f59fa8262..b306ed3d0abb 100644 --- a/src/postgres/src/backend/utils/misc/guc.c +++ b/src/postgres/src/backend/utils/misc/guc.c @@ -5637,6 +5637,7 @@ static const char *const map_old_guc_names[] = { static const char *const YbDbAdminVariables[] = { "session_replication_role", "yb_make_next_ddl_statement_nonbreaking", + "yb_make_next_ddl_statement_nonincrementing", }; diff --git a/src/yb/yql/pgwrapper/pg_catalog_version-test.cc b/src/yb/yql/pgwrapper/pg_catalog_version-test.cc index e809828af032..7d675c619416 100644 --- a/src/yb/yql/pgwrapper/pg_catalog_version-test.cc +++ b/src/yb/yql/pgwrapper/pg_catalog_version-test.cc @@ -1536,6 +1536,7 @@ TEST_F(PgCatalogVersionTest, NonIncrementingDDLMode) { const string kDatabaseName = "yugabyte"; auto conn = ASSERT_RESULT(ConnectToDB(kDatabaseName)); + ASSERT_OK(conn.Execute("SET ROLE yb_db_admin")); ASSERT_OK(conn.Execute("CREATE TABLE t1(a int)")); auto version = ASSERT_RESULT(GetCatalogVersion(&conn));