Use server_encoding as remote connection encoding
authorMarko Kreen <markokr@gmail.com>
Thu, 11 Sep 2008 15:04:41 +0000 (15:04 +0000)
committerMarko Kreen <markokr@gmail.com>
Thu, 11 Sep 2008 15:04:41 +0000 (15:04 +0000)
Previous use of client_encoding was wrong, but seemed to work because
of binary i/o which bypassed the encoding checks.

Noticed and fixed by Hiroshi Saito

src/execute.c

index 5bba3a881d0c6bb7d477020db35fbdf6b651283c..a8b8cd05d17662a48c91de4c87d4ce2d8ab22241 100644 (file)
@@ -103,9 +103,9 @@ tune_connection(ProxyFunction *func, ProxyConnection *conn)
        conn->same_ver = cmp_branch(dst_ver, PG_VERSION);
 
        /*
-        * sync client_encoding
+        * Make sure remote I/O is done using local server_encoding.
         */
-       this_enc = pg_get_client_encoding_name();
+       this_enc = GetDatabaseEncodingName();
        dst_enc = PQparameterStatus(conn->db, "client_encoding");
        if (dst_enc && strcmp(this_enc, dst_enc))
        {