Skip to content

Fix REASSIGN OWNED with keyword target roles - #8746

Merged
ibrahim halatci (ihalatci) merged 1 commit into
pg19-supportfrom
ihalatci-fix-reassign-owned-keyword-role
Aug 10, 2026
Merged

ibrahim halatci (ihalatci) merged 1 commit into
pg19-supportfrom
ihalatci-fix-reassign-owned-keyword-role

Conversation

@ihalatci

Copy link
Copy Markdown
Contributor

Summary

  • fix REASSIGN OWNED BY ... TO CURRENT_USER and other keyword target roles by resolving the complete RoleSpec with get_rolespec_oid
  • avoid passing a NULL RoleSpec->rolename to get_role_oid, which caused the syscache hash path to segfault
  • add regression coverage for keyword target roles plus a negative control that confirms an unrelated role remains unchanged

Validation

  • PostgreSQL 17 multi-node regression validation
  • PostgreSQL 18 multi-node regression validation
  • PostgreSQL 19 multi-node regression validation

Scope

This is a general, PostgreSQL-version-independent fix. It is independent of the property-graph compatibility change and can be reviewed and backported on its own.

Closes #8745

@codecov

codecov Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.74%. Comparing base (ff8f1f8) to head (7c7c207).
⚠️ Report is 26 commits behind head on pg19-support.

Additional details and impacted files
@@               Coverage Diff                @@
##           pg19-support    #8746      +/-   ##
================================================
- Coverage         88.80%   88.74%   -0.06%     
================================================
  Files               288      289       +1     
  Lines             64416    65002     +586     
  Branches           8100     8191      +91     
================================================
+ Hits              57206    57689     +483     
- Misses             4873     4951      +78     
- Partials           2337     2362      +25     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

GetNewRoleAddress() resolved the target role with
get_role_oid(stmt->newrole->rolename, false). For keyword role
specifications such as CURRENT_USER, CURRENT_ROLE and SESSION_USER the
parser leaves RoleSpec->rolename NULL, so the backend segfaulted with a
NULL dereference inside the syscache hash computation
(namehashfast -> CatalogCacheComputeHashValue -> get_role_oid).

Resolve the role with get_rolespec_oid() instead, which handles every
RoleSpec variant and has been available since PostgreSQL 10, so no
version gate is needed.

This is not PostgreSQL 19 specific and reproduces on every supported
major version. It surfaced now because PG19's graph_table_rls vanilla
test is the first upstream test to run REASSIGN OWNED BY ... TO
current_user with the Citus extension loaded.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@ihalatci
ibrahim halatci (ihalatci) force-pushed the ihalatci-fix-reassign-owned-keyword-role branch from a202355 to 7c7c207 Compare August 10, 2026 04:14
@ihalatci
ibrahim halatci (ihalatci) merged commit a38991f into pg19-support Aug 10, 2026
183 of 195 checks passed
@ihalatci
ibrahim halatci (ihalatci) deleted the ihalatci-fix-reassign-owned-keyword-role branch August 10, 2026 08:18
@ihalatci ibrahim halatci (ihalatci) linked an issue Aug 10, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix REASSIGN OWNED with keyword target roles

3 participants