Re: Accessing composite type columns from C

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Reg Me Please <regmeplease(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Accessing composite type columns from C
Date: 2008-01-17 16:09:53
Message-ID: 9614.1200586193@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Reg Me Please <regmeplease(at)gmail(dot)com> writes:
> Is there a way with the libpq to access "subcolumns" in a composite type
> column?

libpq knows nothing in particular about composite columns. You'd need
to parse out the data for yourself, per the syntax rules at
http://www.postgresql.org/docs/8.2/static/rowtypes.html#AEN5986

Depending on what you're doing, it might be better to expand the
column at the server side, ie, "SELECT (ccol).* FROM ..."

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2008-01-17 16:16:41 Re: Can't make backup (again)
Previous Message Tom Hart 2008-01-17 16:03:43 Re: advocacy: drupal and PostgreSQL