agora inbox for pgsql-interfaces@postgresql.org
help / color / mirror / Atom feedFrom: alexandros_e <alexandros.ef@gmail.com>
To: pgsql-interfaces@postgresql.org
Subject: C++ read int array with libpqxx
Date: Fri, 7 Mar 2014 12:38:47 -0800 (PST)
Message-ID: <1394224727721-5795212.post@n5.nabble.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-interfaces>
Hello experts,
I want to retrieve integer arrays (type integer[]) from Postgres DB through
C++ and libpqxx. Older posts (2007) suggest to read the array as string and
make a custom function that parses the text representation '{1,2,3}' and
then get the integer values. Has anything improved on this matter? Can I
actually get the integer array directly?
If not should I do "SELECT id, myIntegerArrayField FROM DBTable" within C++
or I should first do the text conversion from SQL like "SELECT id,
array_to_string(myIntegerArrayField,',') FROM DBTable" and then parse the
string returned.
I appreciate your feedback.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/C-read-int-array-with-libpqxx-tp5795212.html
Sent from the PostgreSQL - interfaces mailing list archive at Nabble.com.
--
Sent via pgsql-interfaces mailing list (pgsql-interfaces@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-interfaces
Message-ID: <1394224727721-5795212.post@n5.nabble.com>
Permalink: ../1394224727721-5795212.post@n5.nabble.com/
Also on: postgresql.org/message-id/1394224727721-5795212.post@n5.nabble.com
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: alexandros.ef@gmail.com
Subject: Re: C++ read int array with libpqxx
In-Reply-To: <1394224727721-5795212.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox