[DB-SIG] db paramstyle for arrays

Federico Di Gregorio fog at initd.org
Tue Apr 6 17:14:02 EDT 2004


Il mar, 2004-04-06 alle 22:25, Lee Harr ha scritto:
> >LH> Is there a special DB API style for inserting array values
> >LH> in
> >LH> to a database?
> >
> >What DB API module do you use?  For pyPgSQL the answer is in FAQ
> >(http://pypgsql.sourceforge.net/pypgsql-faq.html):
> >If you want to use ARRAYs, you'll now need to wrap your (nested)
> >lists with PgSQL.PgArray
> >
> 
> I am using psycopg.
> 
> grep'ng through the psycopg distribution does not reveal
> mention of ARRAY, so I guess it does not support that.

ouch, right.

> Is there anything about it in the DB API? I looked through pep 249
> but I do not see anything. I could create a patch
> for psycopg to do something like the way pyPgSQL does it, but
> it would be good if they were all the same...

if you want to patch, please try psycopg 2 alpha that has a nice support
for custom python->postgresql type conversions.

-- 
Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                fog at debian.org
INIT.D Developer                                           fog at initd.org
                             Best friends are often failed lovers. -- Me
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata
Url : http://mail.python.org/pipermail/db-sig/attachments/20040406/704f35b3/attachment.bin


More information about the DB-SIG mailing list