pgsql: Set all variable-length fields of pg_attribute to null on column

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Set all variable-length fields of pg_attribute to null on column
Date: 2023-12-22 21:00:31
Message-ID: E1rGmdC-00BRUq-IG@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Set all variable-length fields of pg_attribute to null on column drop

When a column is dropped, the fields attacl, attoptions, and
attfdwoptions were kept unchanged. This is probably harmless, but it
seems wasteful, and leaves potentially dangling data lying around (for
example, attacl could contain references to users that are later also
dropped).

Change this to set those fields to null when a column is marked as
dropped.

Reviewed-by: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Discussion: https://www.postgresql.org/message-id/flat/249d819d-1763-4580-8110-0bf91a0f08b7(at)eisentraut(dot)org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/3e2e0d5ad7fcb89d18a71cbfc885ef184e1b6f2e

Modified Files
--------------
src/backend/catalog/heap.c | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2023-12-23 16:50:46 pgsql: Set readline-relevant ENV vars in interactive_psql(), not caller
Previous Message Tom Lane 2023-12-22 18:32:26 pgsql: Stop generating plain-text INSTALL instructions.