From: | Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix DROP DATABASE for databases with many ACLs |
Date: | 2024-08-18 22:27:53 |
Message-ID: | E1sfoNN-000LOa-7a@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix DROP DATABASE for databases with many ACLs
Commit c66a7d75e652 modified DROP DATABASE so that if interrupted, the
database is known to be in an invalid state and can only be dropped.
This is done by setting a flag using an in-place update, so that it's
not lost in case of rollback.
For databases with many ACLs, this may however fail like this:
ERROR: wrong tuple length
This happens because with many ACLs, the pg_database.datacl attribute
gets TOASTed. The dropdb() code reads the tuple from the syscache, which
means it's detoasted. But the in-place update expects the tuple length
to match the on-disk tuple.
Fixed by reading the tuple from the catalog directly, not from syscache.
Report and fix by Ayush Tiwari. Backpatch to 12. The DROP DATABASE fix
was backpatched to 11, but 11 is EOL at this point.
Reported-by: Ayush Tiwari
Author: Ayush Tiwari
Reviewed-by: Tomas Vondra
Backpatch-through: 12
Discussion: https://postgr.es/m/CAJTYsWWNkCt+-UnMhg=BiCD3Mh8c2JdHLofPxsW3m2dkDFw8RA@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/0f92b230f88b98c34b9804c4b4226e0d1822dc53
Modified Files
--------------
src/backend/commands/dbcommands.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tomas Vondra | 2024-08-18 22:28:08 | pgsql: Fix DROP DATABASE for databases with many ACLs |
Previous Message | Thomas Munro | 2024-08-18 20:00:33 | pgsql: Fix cpluspluscheck for pg_verifybackup.h. |