This project is archived and is in readonly mode.

#68 ✓resolved
Dolf Andringa

copy_from ValueError "column list to long"

Reported by Dolf Andringa | August 30th, 2011 @ 04:04 PM

Hi All,

I am using psycopg2 happyly to import data from csv files from other databases into a postgres database for analysis. Today I ran into a ValueError raised by cursor.copy_from with the message "column list too long".
After digging around some in the source I saw in cursor_type.h in _psyco_curs_copy_columns the if statement
if (offset + collen > DEFAULT_COPYBUFF - 2) {

Py_DECREF(col);
Py_DECREF(coliter);
PyErr_SetString(PyExc_ValueError, "column list too long");
return -1;

}

Why is psycopg2 only allowing a maximum number of characters in the column list? This doesn't seem to make much sense to me unless I am missing something. I was told by the people in the #postgresql channel on irc.freenode.net that this is not due to a limitation in postgresql itself. Is that correct?
Is there any way to allow a longer column length somehow?
Cheers,

Dolf.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins

Tags

Pages