Bart Smink <bartsmink@gmail.com> writes:
> Thanks for taking a look at my code. The difference is because this table
> will be created once by a setup script that connects without the
> search_path option selecting a scheme in connect, whereas the program that
> will run on this table connects with a search_path option. Changing the
> command to
> res = PQexecParams(conn,
> "SELECT * FROM \"Schema1\".testdata;",
> 0,
> NULL,
> NULL,
> NULL,
> NULL,
> 1
> );
> makes no difference, the test still fails.
[ looks closer... ] Oh! You are asking for binary result format
(resultFormat = 1 in the call), so what you get back is not a
pointer to the string "1234", it's a pointer to whatever the
defined binary format for a numeric is. That likely begins with
a zero byte, causing your program to think it's an empty string.
regards, tom lane