Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 0F869B88AF5 for ; Sat, 4 Jun 2011 10:20:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 27888-08 for ; Sat, 4 Jun 2011 13:20:35 +0000 (UTC) Received: from mx2.hub.org (mx2.hub.org [200.46.204.254]) by mail.postgresql.org (Postfix) with ESMTP id 95F27B88AEE for ; Sat, 4 Jun 2011 10:20:35 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mx2.hub.org (Postfix) with ESMTP id 46E283EB174A for ; Sat, 4 Jun 2011 04:11:58 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p5479Rre058119 for ; Sat, 4 Jun 2011 07:09:27 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p5479Roc058117; Sat, 4 Jun 2011 07:09:27 GMT (envelope-from www) Date: Sat, 4 Jun 2011 07:09:27 GMT Message-Id: <201106040709.p5479Roc058117@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #6052: ADD COLUMN - ERROR: tables can have at most 1600 columns From: "dinesh" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201106/46 X-Sequence-Number: 30425 The following bug has been logged online: Bug reference: 6052 Logged by: dinesh Email address: dinesh@milkorwater.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). 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