diff options
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r-- | src/backend/commands/copy.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index c4e261549a2..ba371f728d9 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.213.2.2 2005/10/03 23:43:45 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.213.2.3 2006/05/21 20:06:43 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -97,6 +97,7 @@ static bool fe_eof; /* true if detected end of copy data */ static EolType eol_type; /* EOL type of input */ static int client_encoding; /* remote side's character encoding */ static int server_encoding; /* local encoding */ +static int server_max_length; /* local encoding max length */ /* these are just for error messages, see copy_in_error_callback */ static bool copy_binary; /* is it a binary copy? */ @@ -802,6 +803,7 @@ DoCopy(const CopyStmt *stmt) client_encoding = pg_get_client_encoding(); server_encoding = GetDatabaseEncoding(); + server_max_length = pg_database_encoding_max_length(); copy_dest = COPY_FILE; /* default */ copy_file = NULL; @@ -1741,7 +1743,8 @@ static bool CopyReadLine(void) { bool result; - bool change_encoding = (client_encoding != server_encoding); + bool change_encoding = (client_encoding != server_encoding || + server_max_length > 1); int c; int mblen; int j; |