473,382 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

ERROR: tables can have at most 1600 columns

I found this error in /var/log/messages yesterday after a cron job
wouldn't complete:
STATEMENT: ALTER TABLE victoria.eodData DROP COLUMN tickDate;
ERROR: tables can have at most 1600 columns
STATEMENT: ALTER TABLE victoria.eodData ADD COLUMN tickerID INTEGER;
ERROR: tables can have at most 1600 columns
...etc...

The columns didn't exist at the time I tried to drop them, and \dt
showed that the table only contained the normal dozen columns. Because I
use the COPY command I remove columns to match the input from an ftp'ed
file, add the columns, continue processing, etc. After dropping and then
re-creating the table the error didn't recur and processing continued.

My question is this: every night the database is vacuumed-full-analyze:
wouldn't that prevent this condition from happening? Or is there some
other regular maintenance I should be running?

I'll be away for the next week but I look forward to reading any insight
on this when I return.

Thanks
Ron

-- running Postgresql 7.4.2 on debian stable
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #1
5 5148
On Sun, Jun 27, 2004 at 11:11:32AM -0700, Ron St-Pierre wrote:
I found this error in /var/log/messages yesterday after a cron job
wouldn't complete:
STATEMENT: ALTER TABLE victoria.eodData DROP COLUMN tickDate;
ERROR: tables can have at most 1600 columns
STATEMENT: ALTER TABLE victoria.eodData ADD COLUMN tickerID INTEGER;
ERROR: tables can have at most 1600 columns
...etc...

The columns didn't exist at the time I tried to drop them, and \dt
showed that the table only contained the normal dozen columns.
Have you done the DROP COLUMN/ADD COLUMN cycle to this table more than,
say, 1500 times? Because a dropped column is actually only hidden from
the user, but it's still present to the system and it will still affect
the 1600 limit.

Dropping the table and restoring from a backup would bring it to sanity,
as you found out. And it will probably also get you back some
performance (though it may be so small a gain that you may not notice).
My question is this: every night the database is vacuumed-full-analyze:
wouldn't that prevent this condition from happening?


Nope.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The only difference is that Saddam would kill you on private, where the
Americans will kill you in public" (Mohammad Saleh, 39, a building contractor)
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2
Alvaro Herrera <al******@dcc.uchile.cl> writes:
On Sun, Jun 27, 2004 at 11:11:32AM -0700, Ron St-Pierre wrote:
STATEMENT: ALTER TABLE victoria.eodData DROP COLUMN tickDate;
ERROR: tables can have at most 1600 columns
STATEMENT: ALTER TABLE victoria.eodData ADD COLUMN tickerID INTEGER;
ERROR: tables can have at most 1600 columns
Have you done the DROP COLUMN/ADD COLUMN cycle to this table more than,
say, 1500 times? Because a dropped column is actually only hidden from
the user, but it's still present to the system and it will still affect
the 1600 limit.


That is a good theory, but it doesn't quite explain why Ron's getting
the error from DROP COLUMN --- AFAICS, the places that would issue such
an error won't get called in that path.

I tried to reproduce this and could not: after 1600 cycles of adding and
dropping a column, I did indeed start to get "tables can have at most
1600 columns" from ADD, but DROP continued to behave normally.

Ron, are you sure these errors were coming from the DROPs and not only
the ADDs? Can you exhibit a test case?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #3
Hi all,

There is a way to actually eliminate those dropped tables so they don't affect the 1600 columns limit? I know it's very difficult to end up with this problem but apparently "it is" posible.

Thanx in advance,

Jaime Casanova

Tom Lane <tg*@sss.pgh.pa.us> wrote:Alvaro Herrera writes:
On Sun, Jun 27, 2004 at 11:11:32AM -0700, Ron St-Pierre wrote:
STATEMENT: ALTER TABLE victoria.eodData DROP COLUMN tickDate;
ERROR: tables can have at most 1600 columns
STATEMENT: ALTER TABLE victoria.eodData ADD COLUMN tickerID INTEGER;
ERROR: tables can have at most 1600 columns
Have you done the DROP COLUMN/ADD COLUMN cycle to this table more than,
say, 1500 times? Because a dropped column is actually only hidden from
the user, but it's still present to the system and it will still affect
the 1600 limit.


That is a good theory, but it doesn't quite explain why Ron's getting
the error from DROP COLUMN --- AFAICS, the places that would issue such
an error won't get called in that path.

I tried to reproduce this and could not: after 1600 cycles of adding and
dropping a column, I did indeed start to get "tables can have at most
1600 columns" from ADD, but DROP continued to behave normally.

Ron, are you sure these errors were coming from the DROPs and not only
the ADDs? Can you exhibit a test case?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org


---------------------------------
Do You Yahoo!?
Todo lo que quieres saber de Estados Unidos, América Latina y el resto del Mundo.
Visíta Yahoo! Noticias.

Nov 23 '05 #4
On Mon, 2004-06-28 at 14:37, Jaime Casanova wrote:
Hi all,

There is a way to actually eliminate those dropped tables so they
don't affect the 1600 columns limit? I know it's very difficult to end
up with this problem but apparently "it is" posible.

You may want to try recreating the table with select into when you're
changing it. Of course, you'll have to recreate all the fks, indexes,
or other dependent objects.
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 23 '05 #5
Tom Lane wrote:
Alvaro Herrera <al******@dcc.uchile.cl> writes:

On Sun, Jun 27, 2004 at 11:11:32AM -0700, Ron St-Pierre wrote:

STATEMENT: ALTER TABLE victoria.eodData DROP COLUMN tickDate;
ERROR: tables can have at most 1600 columns
STATEMENT: ALTER TABLE victoria.eodData ADD COLUMN tickerID INTEGER;
ERROR: tables can have at most 1600 columns

Have you done the DROP COLUMN/ADD COLUMN cycle to this table more than,
say, 1500 times? Because a dropped column is actually only hidden from
the user, but it's still present to the system and it will still affect
the 1600 limit.


That is a good theory, but it doesn't quite explain why Ron's getting
the error from DROP COLUMN --- AFAICS, the places that would issue such
an error won't get called in that path.

I tried to reproduce this and could not: after 1600 cycles of adding and
dropping a column, I did indeed start to get "tables can have at most
1600 columns" from ADD, but DROP continued to behave normally.

Ron, are you sure these errors were coming from the DROPs and not only
the ADDs? Can you exhibit a test case?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

I re-checked the logs and saw that the error only ocurred on trying to
add the column, sorry for the cut-and-paste mistake. But before that I
tried a test script and had the same result that Tom did. I think that
I'll take Scott's advice and probably use INSERT INTO to re-create the
table each time and avoid the 1600 column error. I am currently using
TRUNCATE to clear the table before each use but it obviously doesn't
re-set the column count.

Thanks again for your help.

Ron
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with...
0
by: Eva | last post by:
Hi, I am creating 2 datatables and am joining them via a relationship i have created. I want to create a parent child relationship in a datagrid (If this is possible???). However i keep...
6
by: Jade | last post by:
Hi, I am trying to create a dataset with 6 tables and 5 relationships created between them. I am creating it in the Form_Load event. However i keep getting the following error... An unhandled...
1
by: cindy | last post by:
Get data into datatable, add to dataset dsSearch " Get data into datatable, add to dataset dsSearch Using In-Memory SQL Engine join the tables and select the filenames from the join, add to...
7
by: scorpion53061 | last post by:
This exception occured while running in the development environment. The debugger didnt catch it though it appeared as a message box prompt........does anyone have insight on this? ...
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
2
by: RSH | last post by:
I have a rather simple script that transfers data from a SQL server database to an Access database. The procedure is intended to be dynamic so I am basically adding a datarow and then passing the...
13
by: Jerry C | last post by:
I am using some sample code from gotdotnet to Create DataSet mappings from a xsd schema. I am geting this error. code and error below. I might mention there is also a publictypelibrary file with...
0
by: John [H2O] | last post by:
There's a lot of greek for me here ... should I post to numpy-discussions as well??? The backtrace is at the bottom.... Thanks! GNU gdb Fedora (6.8-21.fc9) Copyright (C) 2008 Free...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.