Information about the type of elements in an array from libpq

From: Markus Bertheau <twanger(at)bluetwanger(dot)de>
To: Federico Di Gregorio <fog(at)initd(dot)org>, pgsql-general(at)postgresql(dot)org
Cc: Psycopg Mailing List <psycopg(at)lists(dot)initd(dot)org>
Subject: Information about the type of elements in an array from libpq
Date: 2004-08-02 13:21:57
Message-ID: 1091452917.2728.26.camel@dicaprio.akademie1.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

В Пнд, 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(at)bluetwanger(dot)de>

Browse pgsql-general by date

  From Date Subject
Next Message Bill Moran 2004-08-02 13:25:30 Re: Stored procedures
Previous Message Secrétariat 2004-08-02 13:08:09 Stored procedures