The following bug has been logged on the website:
Bug reference: 17127
Logged by: Zhou Digoal
Email address: digoal@126.com
PostgreSQL version: 14beta2
Operating system: CentOS 7.7 x64
Description:
HI, postgresql drop column cann't delete from pg_attribute, so it will up to
1600 limits soon when add and drop column frequenc.
```
do language plpgsql $$
declare
sql text := 'create table c (';
begin
for i in 1..1600 loop
sql := sql||'c'||i||' int8,';
end loop;
sql := rtrim(sql,',')||')';
execute sql;
end;
$$;
postgres=# alter table c add column c int8;
ERROR: 54011: tables can have at most 1600 columns
LOCATION: ATExecAddColumn, tablecmds.c:6573
postgres=# alter table c drop column c1;
ALTER TABLE
postgres=# alter table c add column c int8;
ERROR: 54011: tables can have at most 1600 columns
LOCATION: ATExecAddColumn, tablecmds.c:6573
postgres=# vacuum full c;
VACUUM
postgres=# alter table c add column c int8;
ERROR: 54011: tables can have at most 1600 columns
LOCATION: ATExecAddColumn, tablecmds.c:6573
postgres=# select attname from pg_attribute where attrelid ='c'::regclass
and attisdropped;
attname
------------------------------
........pg.dropped.1........
(1 row)
```
best regards, digoal