Hi, When I tried to use libpq, I found that libpq example[1] does not work. That's because SELECT pg_catlog.set_config() never returns PGRES_COMMAND_OK which is expected, but actually returns PGRES_TUPLES_OK.
Patch attached. I changed both src/test/example and document. [1] https://www.postgresql.org/docs/devel/static/libpq-example.html (By the way, I'm wondering why these examples are placed under src/test. They are just examples and not regression tests.) Best regards, Takeshi Ideriha
0001-libpq-example-fix.patch
Description: 0001-libpq-example-fix.patch