BUG #17127: drop column cann't delete from pg_attribute, so it will up to 1600 limits soon

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: digoal(at)126(dot)com
Subject: BUG #17127: drop column cann't delete from pg_attribute, so it will up to 1600 limits soon
Date: 2021-07-29 02:35:30
Message-ID: 17127-f973fb9d41bae9ca@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 17127
Logged by: Zhou Digoal
Email address: digoal(at)126(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2021-07-29 03:35:04 Re: BUG #17127: drop column cann't delete from pg_attribute, so it will up to 1600 limits soon
Previous Message Alvaro Herrera 2021-07-28 20:01:01 Re: BUG #17126: Server crashes on dropping user while enumerating owned objects that are droppped concurrently