[psycopg] Parse record type into tuple - Mailing list psycopg

From Dmytro Starosud
Subject [psycopg] Parse record type into tuple
Date
Msg-id CANC2W+A88-8b9VzEkTh1cma9ezTtvNa7Z6gK6_LL1e7udZLjFA@mail.gmail.com
Whole thread Raw
Responses Re: [psycopg] Parse record type into tuple
Re: [psycopg] Parse record type into tuple
List psycopg
Hello guys

I do following interactions with DB:

In [48]: conn = psycopg2.connect("dbname=... user=... password=...")
In [49]: cur = conn.cursor()
In [50]: cur.execute("select (1, 2)")
In [51]: cur.fetchone()
Out[51]: ('(1,2)',)

Is it possible to get that tuple parsed into python tuple in the same way array works?

In [55]: cur.execute("select array[1, 2]")
In [56]: cur.fetchone()
Out[56]: ([1, 2],)

Looks like that can be done if I register composite type for that tuple.
But I would like it to work with any tuple.

Please assist.

Thanks in advance!
Dmytro 

psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: [psycopg] Psycopg 2.7.3.1 released
Next
From: Rory Campbell-Lange
Date:
Subject: Re: [psycopg] Parse record type into tuple