Re: [GENERAL] arrays returned in text format

2016-03-05 Thread Konstantin Izmailov
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

Re: [GENERAL] arrays returned in text format

2016-03-04 Thread Tom Lane
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

Re: [GENERAL] arrays returned in text format

2016-03-04 Thread Konstantin Izmailov
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

Re: [GENERAL] arrays returned in text format

2016-03-04 Thread Tom Lane
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

Re: [GENERAL] arrays returned in text format

2016-03-04 Thread Konstantin Izmailov
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

Re: [GENERAL] arrays returned in text format

2016-03-04 Thread Tom Lane
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

[GENERAL] arrays returned in text format

2016-03-04 Thread Konstantin Izmailov
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