You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pg_db_role_setting 的 ALTER ... SET ... TO DEFAULT 可绕过新限制 #1374
Hi, I'd like to work on this if no one has started yet.
Plan (based on the report): in src/backend/catalog/pg_db_role_setting.c, the GUC_DISALLOW_IN_DB_ROLE_SETTING check currently runs only when valuestr != NULL. Since ALTER ... SET ... TO DEFAULT / RESET makes ExtractSetVariableArgs() return NULL, the check is skipped and the restriction is bypassed. I'd key the restriction check off the variable name (stmt->name) regardless of whether a value is supplied, so the TO DEFAULT / RESET path is also blocked. I'd also add a regression test.
Happy to adjust if you'd prefer a different approach. Thanks!
Activity
jiaoshuntian commentedon Jun 30, 2026
We will follow up on this issue.
123123213weqw commentedon Jul 8, 2026
Hi, I'd like to work on this if no one has started yet.
Plan (based on the report): in
src/backend/catalog/pg_db_role_setting.c, theGUC_DISALLOW_IN_DB_ROLE_SETTINGcheck currently runs only whenvaluestr != NULL. SinceALTER ... SET ... TO DEFAULT/RESETmakesExtractSetVariableArgs()return NULL, the check is skipped and the restriction is bypassed. I'd key the restriction check off the variable name (stmt->name) regardless of whether a value is supplied, so the TO DEFAULT / RESET path is also blocked. I'd also add a regression test.Happy to adjust if you'd prefer a different approach. Thanks!