Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WM7qt-0000H2-BN for pgsql-interfaces@arkaria.postgresql.org; Sat, 08 Mar 2014 03:23:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WM7qs-0000Ie-Ma for pgsql-interfaces@arkaria.postgresql.org; Sat, 08 Mar 2014 03:23:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WM1Xh-0003GI-Ie for pgsql-interfaces@postgresql.org; Fri, 07 Mar 2014 20:38:53 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WM1Xe-0001Xy-17 for pgsql-interfaces@postgresql.org; Fri, 07 Mar 2014 20:38:52 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1WM1Xb-0003w9-Nm for pgsql-interfaces@postgresql.org; Fri, 07 Mar 2014 12:38:47 -0800 Date: Fri, 7 Mar 2014 12:38:47 -0800 (PST) From: alexandros_e To: pgsql-interfaces@postgresql.org Message-ID: <1394224727721-5795212.post@n5.nabble.com> Subject: C++ read int array with libpqxx MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.8 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-interfaces Precedence: bulk Sender: pgsql-interfaces-owner@postgresql.org 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