Add hint for "invalid byte sequence for encoding" error message,
authorBruce Momjian <[email protected]>
Tue, 22 Aug 2006 03:38:13 +0000 (03:38 +0000)
committerBruce Momjian <[email protected]>
Tue, 22 Aug 2006 03:38:13 +0000 (03:38 +0000)
suggesting review of client_encoding.

src/backend/utils/mb/wchar.c

index 7cf4473d96f72afa585fdbefd7150c83af49ccaf..6e2056ffe81e2b8d81faa0360ef740c68d968128 100644 (file)
@@ -1325,7 +1325,10 @@ report_invalid_encoding(int encoding, const char *mbstr, int len)
                        (errcode(ERRCODE_CHARACTER_NOT_IN_REPERTOIRE),
                         errmsg("invalid byte sequence for encoding \"%s\": 0x%s",
                                        pg_enc2name_tbl[encoding].name,
-                                       buf)));
+                                       buf),
+                        errhint("This failure can also happen if the byte sequence does not "
+                                        "match the encoding expected by the server, which is controlled "
+                                        "by \"client_encoding\".")));
 }
 
 /*