summaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-07-01 14:06:40 +0200
committerPeter Eisentraut <peter_e@gmx.net>2018-07-01 14:06:40 +0200
commit7bdea6263543c0dabf4d374b3c8d2c3a1d91649e (patch)
tree0bfaffd909661862c49b01274d7f1519b0701b15 /doc/src
parent56b4da8c9d11f685f1fe2e11cf015e850913b6b8 (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')
-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 515bcb67794..d67212b8311 100644
--- a/doc/src/sgml/libpq.sgml
+++ b/doc/src/sgml/libpq.sgml
@@ -8440,7 +8440,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);
@@ -8610,7 +8610,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 771795ae668..f56aeebddb2 100644
--- a/doc/src/sgml/lobj.sgml
+++ b/doc/src/sgml/lobj.sgml
@@ -936,7 +936,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);