diff options
Diffstat (limited to 'src/interfaces/libpq/fe-exec.c')
-rw-r--r-- | src/interfaces/libpq/fe-exec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index 7b46c14118b..c42ede02e85 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.192 2007/01/05 22:20:01 momjian Exp $ + * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.193 2007/10/13 20:18:42 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -630,11 +630,14 @@ pqSaveParameterStatus(PGconn *conn, const char *name, const char *value) * standard_conforming_strings, and convert server version to a numeric * form. We keep the first two of these in static variables as well, so * that PQescapeString and PQescapeBytea can behave somewhat sanely (at - * least in single- connection-using programs). + * least in single-connection-using programs). */ if (strcmp(name, "client_encoding") == 0) { conn->client_encoding = pg_char_to_encoding(value); + /* if we don't recognize the encoding name, fall back to SQL_ASCII */ + if (conn->client_encoding < 0) + conn->client_encoding = PG_SQL_ASCII; static_client_encoding = conn->client_encoding; } else if (strcmp(name, "standard_conforming_strings") == 0) |