summaryrefslogtreecommitdiff
path: root/doc/src/sgml
diff options
context:
space:
mode:
authorPeter Eisentraut2018-07-01 12:06:40 +0000
committerPeter Eisentraut2018-07-01 12:09:27 +0000
commit7fbbbe1efbfb0cb55b97982f7dbefe68682e9e2d (patch)
tree796c5dd1f9ddc2aa73c688cab3836f0b4e30c502 /doc/src/sgml
parent6acb4e89fe472e74bcbb3d3b997cccef6c026be9 (diff)
Fix libpq example programs
When these programs call pg_catalog.set_config, they need to check for PGRES_TUPLES_OK instead of PGRES_COMMAND_OK. Fix for 5770172cb0c9df9e6ce27c507b449557e5b45124. Reported-by: Ideriha, Takeshi <ideriha.takeshi@jp.fujitsu.com>
Diffstat (limited to 'doc/src/sgml')
-rw-r--r--doc/src/sgml/libpq.sgml4
-rw-r--r--doc/src/sgml/lobj.sgml2
2 files changed, 3 insertions, 3 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml
index 0dab74f2a56..b910e03c63d 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -7848,7 +7848,7 @@ main(int argc, char **argv)
/* Set always-secure search path, so malicous users can't take control. */
res = PQexec(conn,
"SELECT pg_catalog.set_config('search_path', '', false)");
- if (PQresultStatus(res) != PGRES_COMMAND_OK)
+ if (PQresultStatus(res) != PGRES_TUPLES_OK)
{
fprintf(stderr, "SET failed: %s", PQerrorMessage(conn));
PQclear(res);
@@ -8014,7 +8014,7 @@ main(int argc, char **argv)
/* Set always-secure search path, so malicous users can't take control. */
res = PQexec(conn,
"SELECT pg_catalog.set_config('search_path', '', false)");
- if (PQresultStatus(res) != PGRES_COMMAND_OK)
+ if (PQresultStatus(res) != PGRES_TUPLES_OK)
{
fprintf(stderr, "SET failed: %s", PQerrorMessage(conn));
PQclear(res);
diff --git a/doc/src/sgml/lobj.sgml b/doc/src/sgml/lobj.sgml
index f87b61bf8c0..809061892d1 100644
--- a/doc/src/sgml/lobj.sgml
+++ b/doc/src/sgml/lobj.sgml
@@ -823,7 +823,7 @@ main(int argc, char **argv)
/* Set always-secure search path, so malicous users can't take control. */
res = PQexec(conn,
"SELECT pg_catalog.set_config('search_path', '', false)");
- if (PQresultStatus(res) != PGRES_COMMAND_OK)
+ if (PQresultStatus(res) != PGRES_TUPLES_OK)
{
fprintf(stderr, "SET failed: %s", PQerrorMessage(conn));
PQclear(res);