Skip to content

Commit 1eb2231

Browse files
committed
Allow pg_upgrade with PGCLIENTENCODING set
This used to work, but since PGCLIENTENCODING is now a connection option variable, pg_upgrade would prevent it.
1 parent 1471a14 commit 1eb2231

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

contrib/pg_upgrade/server.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -326,21 +326,26 @@ check_for_libpq_envvars(void)
326326

327327
/* Get valid libpq env vars from the PQconndefaults function */
328328

329-
start = option = PQconndefaults();
329+
start = PQconndefaults();
330330

331-
while (option->keyword != NULL)
331+
for (option = start; option->keyword != NULL; option++)
332332
{
333-
const char *value;
334-
335-
if (option->envvar && (value = getenv(option->envvar)) && strlen(value) > 0)
333+
if (option->envvar)
336334
{
337-
found = true;
335+
const char *value;
338336

339-
pg_log(PG_WARNING,
340-
"libpq env var %-20s is currently set to: %s\n", option->envvar, value);
341-
}
337+
if (strcmp(option->envvar, "PGCLIENTENCODING") == 0)
338+
continue;
342339

343-
option++;
340+
value = getenv(option->envvar);
341+
if (value && strlen(value) > 0)
342+
{
343+
found = true;
344+
345+
pg_log(PG_WARNING,
346+
"libpq env var %-20s is currently set to: %s\n", option->envvar, value);
347+
}
348+
}
344349
}
345350

346351
/* Free the memory that libpq allocated on our behalf */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy