Re: arrays returned in text format

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Konstantin Izmailov <pgfizm(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: arrays returned in text format
Date: 2016-03-05 05:03:27
Message-ID: 13929.1457154207@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Konstantin Izmailov <pgfizm(at)gmail(dot)com> writes:
> I'm using libpq to read array values, and I noticed that sometimes the
> values are returned in Binary and sometimes - in Text format.

> 1. Returned in Binary format:
> int formats[1] = { 1 }; // request binary format
> res = PQexec(conn, "SELECT rgField FROM aTable", 1, formats);
> assert(PQfformat(res, 0) == 1); // this is OK

> 2. Returned in Text format:
> res = PQexec(conn, "SELECT ARRAY[1,2,3]", 1, formats);
> assert(PQfformat(res, 0) == 1); // this fails???

Um, that is not the call signature of PQexec(), nor of any of its
variants.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Konstantin Izmailov 2016-03-05 05:28:17 Re: arrays returned in text format
Previous Message Konstantin Izmailov 2016-03-05 04:32:55 arrays returned in text format