Set all variable-length fields of pg_attribute to null on column drop
Peter Eisentraut <peter@eisentraut.org>
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-11-30T11:23:46Z
Lists: pgsql-hackers
Attachments
- v1-0001-Set-all-variable-length-fields-of-pg_attribute-to.patch (text/plain) patch v1-0001
I noticed that when a column is dropped, RemoveAttributeById() clears out certain fields in pg_attribute, but it leaves the variable-length fields at the end (attacl, attoptions, and attfdwoptions) unchanged. This is probably harmless, but it seems wasteful and unclean, and leaves potentially dangling data lying around (for example, attacl could contain references to users that are later also dropped). I suggest the attached patch to set those fields to null when a column is marked as dropped.
Commits
-
Set all variable-length fields of pg_attribute to null on column drop
- 3e2e0d5ad7fc 17.0 landed
-
Support column-level privileges, as required by SQL standard.
- 3cb5d6580a33 8.4.0 cited