Re: COPY: "column list too long"

Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Organization initd.org
Message-ID <1249816280.9296.2.camel@erin>
Il giorno mer, 05/08/2009 alle 12.43 +1200, Robert Coup ha scritto:
> Hey folks,

> ran into a new one
> today: the above error when trying to do a COPY FROM with a 116-column source.
> 
> From digging in the source, psyco_curs_copy_from (cursor_type.c:1070)
> builds a 1KB string of the column names to pass to the DB. Is there
> any particular reason it's 1KB and not 2 or 4 or 8 (ie. can i change
> it)? I noted that in 2.0.6 it used a DEFAULT_COPYBUFF constant but has
> since been hardcoded.

Sorry for being late, I am just back from holiday. There is no real
reason, except that nobody ever used such an high number of columns.
Making the code to dynamically resize the buffer is not worth the work,
IMHO, so what if next version just uses a larger buffer. Say, 16K should
be enough for almost any real-world COPY.

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                [email protected]
INIT.D Developer                                           fog-NGVKUo/i/[email protected]
 I porcellini di terra sono davvero Crostacei! Non lo sapevo!
  Certo che sono crostacei, hanno la crosta!
  Allora la pizza è un crostaceo?!               -- discorso all'ESC2k07

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkp+rtgACgkQvcCgrgZGjes6kQCbBW2DzX6wpK7y+IKOiaby83/9
cMgAoLTBkNrh/btSxfwGVSCOqnjeInWW
=l00J
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.