diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2011-04-07 19:22:34 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2011-04-07 19:24:47 +0300 |
commit | 1eb2231fc46bbfa85b47c19d88f72162b323aa51 (patch) | |
tree | f994db2855a90e23d4b08483d973e41618520a84 | |
parent | 1471a147f09f737511945ac59ca3162469d1a0c0 (diff) | |
download | postgresql-1eb2231fc46bbfa85b47c19d88f72162b323aa51.tar.gz postgresql-1eb2231fc46bbfa85b47c19d88f72162b323aa51.zip |
Allow pg_upgrade with PGCLIENTENCODING set
This used to work, but since PGCLIENTENCODING is now a connection
option variable, pg_upgrade would prevent it.
-rw-r--r-- | contrib/pg_upgrade/server.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c index b0df99cede6..a7d57872346 100644 --- a/contrib/pg_upgrade/server.c +++ b/contrib/pg_upgrade/server.c @@ -326,21 +326,26 @@ check_for_libpq_envvars(void) /* 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 && (value = getenv(option->envvar)) && strlen(value) > 0) + if (option->envvar) { - found = true; + const char *value; - pg_log(PG_WARNING, - "libpq env var %-20s is currently set to: %s\n", option->envvar, value); - } + if (strcmp(option->envvar, "PGCLIENTENCODING") == 0) + 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 */ |