logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

[GENERAL] Information about the type of elements in an array from libpq: msg#00013

Subject: [GENERAL] Information about the type of elements in an array from libpq
В Пнд, 02.08.2004, в 14:49, Federico Di Gregorio пишет:
> On lun, 2004-08-02 at 14:30 +0200, Markus Bertheau wrote:
> > Hi,
> > 
> > I wonder if there is some kind of support for PostgreSQL's arrays in
> > psycopg? The fetch routines return the literal array syntax of
> > PostgreSQL. I'd want the fetch routines to return a list for
> > PostgreSQL's arrays, with the common types (text, int, timestamp)
> > handled like they are everywhere else in psycopg.
> 
> if someone provides me with a foolprof way to extract type information
> from arrays i'll implement it. :/

It seems to me that for TEXT[] PQftype() returns 1009, and 1009 is hard
coded to be array of text, as I understand it (see also pg_type.typelem,
which is 25, the oid for text). Similarly for the other types. Wouldn't
that information be enough?

Thanks

-- 
Markus Bertheau <twanger-5tt9IVl551DqmP00bGT3jg@xxxxxxxxxxxxxxxx>


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend


<Prev in Thread] Current Thread [Next in Thread>