libpq example doesn't work

Started by Ideriha, Takeshialmost 8 years ago3 messageshackers
Jump to latest
#1Ideriha, Takeshi
ideriha.takeshi@jp.fujitsu.com

Hi,

When I tried to use libpq, I found that libpq example[1]https://www.postgresql.org/docs/devel/static/libpq-example.html 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

Attachments:

0001-libpq-example-fix.patchapplication/octet-stream; name=0001-libpq-example-fix.patchDownload+4-5
#2Peter Eisentraut
peter_e@gmx.net
In reply to: Ideriha, Takeshi (#1)
Re: libpq example doesn't work

On 27.06.18 08:29, Ideriha, Takeshi wrote:

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.

Fixed. There were additional similar cases that I fixed also.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

#3Ideriha, Takeshi
ideriha.takeshi@jp.fujitsu.com
In reply to: Peter Eisentraut (#2)
RE: libpq example doesn't work

-----Original Message-----
From: Peter Eisentraut [mailto:peter.eisentraut@2ndquadrant.com]
Sent: Sunday, July 1, 2018 9:17 PM
To: Ideriha, Takeshi/出利葉 健 <ideriha.takeshi@jp.fujitsu.com>; pgsql-hackers
<pgsql-hackers@postgresql.org>
Subject: Re: libpq example doesn't work

On 27.06.18 08:29, Ideriha, Takeshi wrote:

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.

Fixed. There were additional similar cases that I fixed also.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Thank you for the commit. I totally missed the large object examples.

Regards,
Takeshi Ideriha