Re: How to retrieve values of 'array' field using C library (libpq)

From: Joshua Tolley <eggyknap(at)gmail(dot)com>
To: Dmitriy Igrishin <dmitigr(at)gmail(dot)com>
Cc: Anton Maksimenkov <anton200(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to retrieve values of 'array' field using C library (libpq)
Date: 2011-02-10 01:02:49
Message-ID: 4d533955.2af98e0a.15d5.371b@mx.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Feb 09, 2011 at 02:53:37PM +0300, Dmitriy Igrishin wrote:
> > My array is the array of integer values. So maybe there is some native
> > method to retrieve them (as in the 'themoney' example)?
> >
> Not in libpq. Probably, in libpqtypes.

I ended up writing one for pgsnmpd, which you're welcome to use. I can't
guarantee that writing my own was the best way to do it, or that it's free of
bugs. See pg_array.c and pg_array.h at
http://git.postgresql.org/gitweb?p=pgsnmpd.git;a=summary

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2011-02-10 03:16:33 Re: Storing Media Types
Previous Message Tom Lane 2011-02-10 00:33:35 Re: Relative ordering in array aggregation