Skip to content

Commit

Permalink
[#23786] YSQL: add yb_make_next_ddl_statement_nonincrementing to YbDb…
Browse files Browse the repository at this point in the history
…AdminVariables

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
  • Loading branch information
myang2021 committed Sep 18, 2024
1 parent 0dbe7d6 commit 2beb872
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/postgres/src/backend/utils/misc/guc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
};


Expand Down
1 change: 1 addition & 0 deletions src/yb/yql/pgwrapper/pg_catalog_version-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 2beb872

Please sign in to comment.