Tom, I was unable to reproduce the issue with standard libpq. Moreover, I
found why it was returned as Text. It was actually a bug in passing
resultFormats in the Bind message. Sorry for the false alert, my fault.
Thank you for the help!
Konstantin
On Fri, Mar 4, 2016 at 10:52 PM, Tom Lane wrote
Konstantin Izmailov writes:
> Whole point of my question was why PG does not return
> binary formatted field when requested (this is a feature supported in the
> protocol).
You haven't presented a test case demonstrating that that happens in
unmodified community source code. If it does happen, I
Tom, that was only a modification for the client-side libpq. The PG is
standard, we are using both 9.4 and 9.5 that were officially released.
I guess there is no standard test for the scenario. But if such test was
created (for checking the format of the returned arrays) it would fail.
Maybe I'm w
Konstantin Izmailov writes:
> Oops, I forgot to mention that we slightly modified libpq to request
> resulting fields formats (since Postgres protocol v3 supports this).
Um. I'm not that excited about supporting bugs in modified variants of
PG. If you can present a test case that fails in stock
Oops, I forgot to mention that we slightly modified libpq to request
resulting fields formats (since Postgres protocol v3 supports this). See
our additions in *Bold*:
PQexec(PGconn *conn, const char *query*, int resultFormatCount, const int*
resultFormats*)
{
if (!PQexecStart(conn))
re
Konstantin Izmailov 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 a
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(PQfforma