Re: "ProgrammingError: can't adapt" when passing arguments to cursor.execute
Adrian Klaver <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <433532905.5075271258740999084.JavaMail.root@sz0030a.emeryville.ca.mail.comcast.net> |
----- "William Carithers" <wccarithers-/[email protected]> wrote: > Hi Adrian, > > Here it is: > quasar=# create table flags ( > plate integer, > mjd integer, > fiber integer, > redshift real, > class varchar(20), > core boolean, > bonus boolean, > midz boolean, > lohiz boolean, > neural boolean, > ukidds boolean, > kde boolean, > likely boolean, > first boolean, > umag real, > gmag real, > rmag real, > imag real, > zmag real, > visual varchar(20)); > CREATE TABLE > > Thanks for your help, > Bill > > I am CC'ing the list as the more eyes the better. I could not replicate your problem. When I ran your query via a script with the data provided it worked. This was with psycopg2 2.0.6 and 2.0.12 and Python 2.5 running on Ubuntu Hardy. You may want to sprinkle your script with some more debug information i.e sys.path and psycopg2.__version__ to make sure you are in fact using the module you think you are. I remember there have some issues with Snow Leopard and/or Python 2.6 because modules changed locations. Also I seem to remember 32/64 bit issues with Snow Leopard, others may have a better grip on that. Another thing to look at is whether load is not been changed in the query. Try print curs.mogrify(query,load) in the script to see what is actually happening after the binding of the varia bles. Adrian Klaver [email protected]