mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
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
5770172cb0.
Reported-by: Ideriha, Takeshi <ideriha.takeshi@jp.fujitsu.com>
This commit is contained in:
@@ -80,7 +80,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);
|
||||
|
||||
Reference in New Issue
Block a user