forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0f92b23
committed
Fix DROP DATABASE for databases with many ACLs
Commitc66a7d7 modified DROP DATABASE so that if interrupted, thedatabase 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'snot lost in case of rollback.For databases with many ACLs, this may however fail like this: ERROR: wrong tuple lengthThis happens because with many ACLs, the pg_database.datacl attributegets TOASTed. The dropdb() code reads the tuple from the syscache, whichmeans it's detoasted. But the in-place update expects the tuple lengthto 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 fixwas backpatched to 11, but 11 is EOL at this point.Reported-by: Ayush TiwariAuthor: Ayush TiwariReviewed-by: Tomas VondraBackpatch-through: 12Discussion:https://postgr.es/m/CAJTYsWWNkCt+-UnMhg=BiCD3Mh8c2JdHLofPxsW3m2dkDFw8RA@mail.gmail.com1 parentd426718 commit0f92b23
1 file changed
+16
-1
lines changedLines changed: 16 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1650 | 1650 |
| |
1651 | 1651 |
| |
1652 | 1652 |
| |
| 1653 | + | |
| 1654 | + | |
1653 | 1655 |
| |
1654 | 1656 |
| |
1655 | 1657 |
| |
| |||
1787 | 1789 |
| |
1788 | 1790 |
| |
1789 | 1791 |
| |
1790 |
| - | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
1791 | 1804 |
| |
1792 | 1805 |
| |
1793 | 1806 |
| |
| |||
1813 | 1826 |
| |
1814 | 1827 |
| |
1815 | 1828 |
| |
| 1829 | + | |
| 1830 | + | |
1816 | 1831 |
| |
1817 | 1832 |
| |
1818 | 1833 |
| |
|
0 commit comments
Comments
(0)