how to clean dropped column in pg_attribute

From: ZongtianHou <zongtianhou(at)icloud(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: how to clean dropped column in pg_attribute
Date: 2020-09-08 09:38:24
Message-ID: 86FE93ED-B4E9-4907-8E5C-FB8A566115E7@icloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi, everyone

I found dropped columns still exist in pg_attribute table. In the below example I drop c2 column and vacuum (full) this table and pg_attribute, it still exist (the last row). how can I clean it away?

postgres=# select * from pg_attribute where attrelid=16515;
attrelid | attname | atttypid | attstattarget | attlen | attnum | attndims | attcacheoff | atttypmod | attbyval | attstorage | attalign | attnotnull | atthasdef | attisdropped | attislocal | attinhcount
----------+------------------------------+----------+---------------+--------+--------+----------+-------------+-----------+----------+------------+----------+------------+-----------+--------------+------------+-------------
16515 | c1 | 23 | -1 | 4 | 1 | 0 | -1 | -1 | t | p | i | f | f | f | t | 0
16515 | c3 | 23 | -1 | 4 | 3 | 0 | -1 | -1 | t | p | i | f | f | f | t | 0
16515 | ctid | 27 | 0 | 6 | -1 | 0 | -1 | -1 | f | p | s | t | f | f | t | 0
16515 | xmin | 28 | 0 | 4 | -3 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0
16515 | cmin | 29 | 0 | 4 | -4 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0
16515 | xmax | 28 | 0 | 4 | -5 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0
16515 | cmax | 29 | 0 | 4 | -6 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0
16515 | tableoid | 26 | 0 | 4 | -7 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0
16515 | gp_segment_id | 23 | 0 | 4 | -8 | 0 | -1 | -1 | t | p | i | t | f | f | t | 0
16515 | c4 | 16 | -1 | 1 | 4 | 0 | -1 | -1 | t | p | c | f | f | f | t | 0
16515 | ........pg.dropped.2........ | 0 | 0 | 4 | 2 | 0 | -1 | -1 | t | p | i | f | f | t | t | 0
(11 rows)

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message hubert depesz lubaczewski 2020-09-08 09:49:17 Re: how to clean dropped column in pg_attribute
Previous Message Ramesh Penuballi 2020-09-08 07:06:21 Regarding the Spikes in the connection pool on our Database in the particular time period.