mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
libpq: change PQconndefaults() to ignore invalid service files
Previously missing or invalid service files returned NULL. Also fix pg_upgrade to report "out of memory" for a null return from PQconndefaults(). Patch by Steve Singer, rewritten by me
This commit is contained in:
@ -325,6 +325,9 @@ check_pghost_envvar(void)
|
||||
|
||||
start = PQconndefaults();
|
||||
|
||||
if (!start)
|
||||
pg_fatal("out of memory\n");
|
||||
|
||||
for (option = start; option->keyword != NULL; option++)
|
||||
{
|
||||
if (option->envvar && (strcmp(option->envvar, "PGHOST") == 0 ||
|
||||
|
Reference in New Issue
Block a user