postgresql/src/bin
Tom Lane 29d75b25b5 Fix pg_dumpall to cope with dangling OIDs in pg_auth_members.
There is a race condition between "GRANT role" and "DROP ROLE",
which allows GRANT to install pg_auth_members entries that refer to
dropped roles.  (Commit 6566133c5 prevented that for the grantor
field, but not for the granted or grantee roles.)  We'll soon fix
that, at least in HEAD, but pg_dumpall needs to cope with the
situation in case of pre-existing inconsistency.  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.

Pre-v16 branches already coped with dangling grantor OIDs by simply
omitting the GRANTED BY clause.  I left that behavior as-is, although
it's somewhat inconsistent with the behavior of later branches.

Reported-by: Virender Singla <virender.cse@gmail.com>
Discussion: https://postgr.es/m/CAM6Zo8woa62ZFHtMKox6a4jb8qQ=w87R2L0K8347iE-juQL2EA@mail.gmail.com
Backpatch-through: 13
2025-02-21 13:37:15 -05:00
..
initdb Update to latest Snowball sources. 2025-02-18 21:13:54 -05:00
pg_amcheck pg_amcheck: Fix test failure on Windows with non-existing role 2025-01-27 08:00:19 +09:00
pg_archivecleanup Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_basebackup Remove various unnecessary (char *) casts 2025-02-20 19:49:27 +01:00
pg_checksums Improve grammar of options for command arrays in TAP tests 2025-01-22 14:47:13 +09:00
pg_combinebackup Refactor TAP test code for file comparisons into new routine in Utils.pm 2025-02-09 16:52:33 +09:00
pg_config Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_controldata Add default_char_signedness field to ControlFileData. 2025-02-21 10:12:08 -08:00
pg_ctl Improve grammar of options for command arrays in TAP tests 2025-01-22 14:47:13 +09:00
pg_dump Fix pg_dumpall to cope with dangling OIDs in pg_auth_members. 2025-02-21 13:37:15 -05:00
pg_resetwal pg_resetwal: Add --char-signedness option to change the default char signedness. 2025-02-21 10:14:36 -08:00
pg_rewind Remove various unnecessary (char *) casts 2025-02-20 19:49:27 +01:00
pg_test_fsync Improve grammar of options for command arrays in TAP tests 2025-01-22 14:47:13 +09:00
pg_test_timing Improve grammar of options for command arrays in TAP tests 2025-01-22 14:47:13 +09:00
pg_upgrade pg_upgrade: Add --set-char-signedness to set the default char signedness of new cluster. 2025-02-21 10:23:39 -08:00
pg_verifybackup Improve grammar of options for command arrays in TAP tests 2025-01-22 14:47:13 +09:00
pg_waldump Improve grammar of options for command arrays in TAP tests 2025-01-22 14:47:13 +09:00
pg_walsummary Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgbench pgbench: Increase RLIMIT_NOFILE if necessary 2025-02-19 19:35:09 -05:00
pgevent Update copyright for 2025 2025-01-01 11:21:55 -05:00
psql psql: Add support for pipelines 2025-02-21 11:19:59 +09:00
scripts Specify the encoding of input to fmtId() 2025-02-10 10:03:37 -05:00
Makefile Update copyright for 2025 2025-01-01 11:21:55 -05:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00