Commit 1eb2231f authored by Peter Eisentraut's avatar Peter Eisentraut

Allow pg_upgrade with PGCLIENTENCODING set

This used to work, but since PGCLIENTENCODING is now a connection
option variable, pg_upgrade would prevent it.
parent 1471a147
...@@ -326,21 +326,26 @@ check_for_libpq_envvars(void) ...@@ -326,21 +326,26 @@ check_for_libpq_envvars(void)
/* Get valid libpq env vars from the PQconndefaults function */ /* Get valid libpq env vars from the PQconndefaults function */
start = option = PQconndefaults(); start = PQconndefaults();
while (option->keyword != NULL) for (option = start; option->keyword != NULL; option++)
{ {
const char *value; if (option->envvar)
if (option->envvar && (value = getenv(option->envvar)) && strlen(value) > 0)
{ {
found = true; const char *value;
pg_log(PG_WARNING, if (strcmp(option->envvar, "PGCLIENTENCODING") == 0)
"libpq env var %-20s is currently set to: %s\n", option->envvar, value); continue;
}
option++; value = getenv(option->envvar);
if (value && strlen(value) > 0)
{
found = true;
pg_log(PG_WARNING,
"libpq env var %-20s is currently set to: %s\n", option->envvar, value);
}
}
} }
/* Free the memory that libpq allocated on our behalf */ /* Free the memory that libpq allocated on our behalf */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment