Add some tests for encoding conversion in COPY TO/FROM
authorMichael Paquier <michael@paquier.xyz>
Mon, 16 Dec 2024 02:23:38 +0000 (11:23 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 16 Dec 2024 02:23:38 +0000 (11:23 +0900)
commit3ad8b840ce8b1d7279f2d0d5fb7d346c0a6a3e8d
tree440fe4131047cfff9b570789e94e5688a3041a12
parentbf9165bb0c5cea71e1a9cfa0c584c4d176f6c36f
Add some tests for encoding conversion in COPY TO/FROM

This adds a couple of tests to trigger encoding conversion when input
and server encodings do not match in COPY FROM/TO, or need_transcoding
set to true in the COPY state data.  These tests rely on UTF8 <-> LATIN1
for the valid cases as LATIN1 accepts any bytes, and UTF8 <-> EUC_JP for
some of the invalid cases where a character cannot be understood,
causing a conversion failure.

Both ENCODING and client_encoding are covered.  Test suggested by Andres
Freund.

Author: Sutou Kouhei
Discussion: https://postgr.es/m/20240206222445.hzq22pb2nye7rm67@awork3.anarazel.de
src/test/regress/expected/copyencoding.out [new file with mode: 0644]
src/test/regress/expected/copyencoding_1.out [new file with mode: 0644]
src/test/regress/parallel_schedule
src/test/regress/sql/copyencoding.sql [new file with mode: 0644]