Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2c53dec
Choose a base ref
...
head repository: postgresql-cfbot/postgresql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 36936d3
Choose a head ref
  • 3 commits
  • 5 files changed
  • 2 contributors

Commits on Feb 20, 2025

  1. Avoid race condition between "GRANT role" and "DROP ROLE".

    Concurrently dropping either the granted role or the grantee
    does not stop GRANT from completing, instead resulting in a
    dangling role reference in pg_auth_members.  That's relatively
    harmless in the short run, but it does result in garbage
    output from pg_dumpall and therefore problems for pg_upgrade.
    
    This patch deals with the problem by adding the granted and grantee
    roles as explicit shared dependencies of the pg_auth_members entry.
    That's a bit indirect, but it works because the pg_shdepend code
    applies the necessary locking and rechecking.
    
    Commit 6566133 previously established similar handling for
    the grantor column of pg_auth_members; it's not clear why it
    didn't cover the other two role OID columns.
    
    A side-effect of this approach is that DROP OWNED BY will now
    drop pg_auth_members entries that mention the target role as
    either the granted or grantee role.  That's clearly appropriate
    for the grantee, and it doesn't seem too far out of line for
    the granted role.  (One could argue that this makes DropRole's
    code to auto-drop pg_auth_members entries unnecessary, but
    I chose to leave it in place since perhaps some people's
    workflows expect that to work without a DROP OWNED BY.)
    
    Reported-by: Virender Singla <[email protected]>
    Discussion: https://postgr.es/m/CAM6Zo8woa62ZFHtMKox6a4jb8qQ=w87R2L0K8347iE-juQL2EA@mail.gmail.com
    Backpatch-through: TBD
    tglsfdc authored and Commitfest Bot committed Feb 20, 2025
    Configuration menu
    Copy the full SHA
    324bcff View commit details
    Browse the repository at this point in the history
  2. Fix pg_dumpall to cope with dangling OIDs in pg_auth_members.

    In view of the bug fixed by the previous patch, we need to allow
    for the possibility of role OIDs in pg_auth_members that don't
    exist in pg_authid.  As pg_dumpall stands, it will emit invalid
    commands like 'GRANT foo TO ""', which causes pg_upgrade to fail.
    Fix it to emit warnings and skip those GRANTs, instead.
    
    There was some discussion of removing the problem by changing
    dumpRoleMembership's query to use JOIN not LEFT JOIN, but that
    would result in silently ignoring such entries.  It seems better
    to produce a warning.
    
    Reported-by: Virender Singla <[email protected]>
    Discussion: https://postgr.es/m/CAM6Zo8woa62ZFHtMKox6a4jb8qQ=w87R2L0K8347iE-juQL2EA@mail.gmail.com
    Backpatch-through: TBD
    tglsfdc authored and Commitfest Bot committed Feb 20, 2025
    Configuration menu
    Copy the full SHA
    4791b29 View commit details
    Browse the repository at this point in the history
  3. [CF 5589] v1 - Fix race condition between role grants and DROP ROLE

    This branch was automatically generated by a robot using patches from an
    email thread registered at:
    
    https://commitfest.postgresql.org/patch/5589
    
    The branch will be overwritten each time a new patch version is posted to
    the thread, and also periodically to check for bitrot caused by changes
    on the master branch.
    
    Patch(es): https://www.postgresql.org/message-id/[email protected]
    Author(s): Tom Lane
    Commitfest Bot committed Feb 20, 2025
    Configuration menu
    Copy the full SHA
    36936d3 View commit details
    Browse the repository at this point in the history
Loading