Re: BUG #6052: ADD COLUMN - ERROR: tables can have at most 1600 columns

From: Juris Kaminskis <juris(dot)kaminskis(at)gmail(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6052: ADD COLUMN - ERROR: tables can have at most 1600 columns
Date: 2023-09-18 14:16:47
Message-ID: CAKJAkzvD-M-bHMfps+kjz8Muc1kqu-u6psYo-qybzRKoY2r3pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello,

I would like to refresh this problem again. The use case: local automated
testing of database migrations. If those migrations ALTER TABLES by adding
and dropping columns, at some point the only valid way out of 1600 columns
error is to reload database. If this is not a big problem would be nice to
solve.

Juris

pirmd., 2023. g. 18. sept., plkst. 17:11 — lietotājs dinesh (<
dinesh(at)milkorwater(dot)com>) rakstīja:

>
> The following bug has been logged online:
>
> Bug reference: 6052
> Logged by: dinesh
> Email address: dinesh(at)milkorwater(dot)com
> PostgreSQL version: 8.4.7
> Operating system: WIndows 7 pro 64 bit
> Description: ADD COLUMN - ERROR: tables can have at most 1600
> columns
> Details:
>
> I have a table which is used during data uploads, a so-called staging
> table.
> This table has a fixed number of columns that [must] match the input CSV
> file. This CSV file is uploaded using COPY command. Following the COPY, a
> new column (meant for indexing) is constructed on this table using some
> application logic; and dropped after that data upload cycle is over.
>
> After some 1500+ cycles, I get the following error:
>
> ERROR: tables can have at most 1600 columns
> SQL state: 54011
> Context: SQL statement "ALTER TABLE stage_fo ADD COLUMN exch_ticker char
> varying"
>
> So it appears that the command
> ALTER TABLE stage_fo DROP COLUMN exch_ticker
> is only producing some soft effects, not sufficient for the db engine.
>
> There was a similar problem mentioned by another user, Ron St-Pierre, in
> June 2004
> (
> http://bytes.com/topic/postgresql/answers/422107-error-tables-can-have-most
> -1600-columns
> <http://bytes.com/topic/postgresql/answers/422107-error-tables-can-have-most-1600-columns>).
> Suggestion made there - to drop/rebuild the table - is not a
> trivial choice.
>
> I will appreciate any helpful pointers that will get us past this
> showstopper. Rewrite is going to be expensive.
>
> Thanks & regards
> Dinesh
> Dinesh
>
>
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2023-09-18 15:22:02 Re: BUG #6052: ADD COLUMN - ERROR: tables can have at most 1600 columns
Previous Message Tom Lane 2023-09-18 14:10:21 Re: BUG #18116: This is definitiv a BUG in INOUT parameter in stored procedures in Postgres 12.16