This project is archived and is in readonly mode.
Error in register_composite python 3
-
Daniele Varrazzo
Hello Joshua,
register_composite works for me.
In psql:
psql (9.0.3, server 9.0.5) Type "help" for help. piro=> create type foo as (a integer, b integer); CREATE TYPE piro=> create table bar (b integer, c integer); CREATE TABLEIn Python:
piro@bagheera:~/dev/psycopg2/build/lib.3.2$ python3.2 Python 3.2.2 (default, Sep 5 2011, 22:09:30) [GCC 4.6.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import psycopg2 >>> cnn = psycopg2.connect('') >>> cur = cnn.cursor() >>> import psycopg2.extras >>> psycopg2.extras.register_composite('foo', cnn) <psycopg2.extras.CompositeCaster object at 0x86d4f0c> >>> cur.execute('select (10,20)::foo') >>> cur.fetchone() (foo(a=10, b=20),) >>> psycopg2.extras.register_composite('bar', cur) <psycopg2.extras.CompositeCaster object at 0x879b12c> >>> cur.execute('select (30,40)::bar') >>> cur.fetchone() (bar(b=30, c=40),)Please check you are doing everything right. If so, please post a reproducible test case.
Thank you.
-
Daniele Varrazzo
- State changed from new to hold
Joshua, no answer? I'm putting the ticket on hold as it works for me and I suspect you just didn't install psycopg correctly. If you can still reproduce the bug feel free to re-open it but provide a failing script. Thank you.
-
Joshua Boshi
Hello Daniele,
I am sorry. I have no time to provide you failing script. I am very busy.
I will send it here when I have some free time.Best regards,
Joshua -
Daniele Varrazzo
- State changed from hold to invalid
Joshua can't be bothered. Never do us. The bug is probably caused by incorrect python3 installation as there's plenty of register_composite tests in the test suite.