From 3cba8240a195c4f323e3f934bfeab308434a9973 Mon Sep 17 00:00:00 2001 From: Itagaki Takahiro Date: Mon, 21 Feb 2011 14:08:04 +0900 Subject: Add ENCODING option to COPY TO/FROM and file_fdw. File encodings can be specified separately from client encoding. If not specified, client encoding is used for backward compatibility. Cases when the encoding doesn't match client encoding are slower than matched cases because we don't have conversion procs for other encodings. Performance improvement would be be a future work. Original patch by Hitoshi Harada, and modified by me. --- doc/src/sgml/file-fdw.sgml | 11 +++++++++++ doc/src/sgml/ref/copy.sgml | 20 +++++++++++++++++--- 2 files changed, 28 insertions(+), 3 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/file-fdw.sgml b/doc/src/sgml/file-fdw.sgml index e2921667184..003c415b43a 100644 --- a/doc/src/sgml/file-fdw.sgml +++ b/doc/src/sgml/file-fdw.sgml @@ -97,6 +97,17 @@ + + encoding + + + + Specifies the file's encoding. + the same as COPY's ENCODING option. + + + + diff --git a/doc/src/sgml/ref/copy.sgml b/doc/src/sgml/ref/copy.sgml index 38424ad04b9..6429a4ef0d7 100644 --- a/doc/src/sgml/ref/copy.sgml +++ b/doc/src/sgml/ref/copy.sgml @@ -40,7 +40,8 @@ COPY { table_name [ ( quote_character' ESCAPE 'escape_character' FORCE_QUOTE { ( column [, ...] ) | * } - FORCE_NOT_NULL ( column [, ...] ) + FORCE_NOT_NULL ( column [, ...] ) | + ENCODING 'encoding_name' @@ -282,6 +283,18 @@ COPY { table_name [ ( + + ENCODING + + + Specifies that the file is encoded in the encoding_name. If this option is + omitted, the current client encoding is used. See the Notes below + for more details. + + + + @@ -377,8 +390,9 @@ COPY count - Input data is interpreted according to the current client encoding, - and output data is encoded in the current client encoding, even + Input data is interpreted according to ENCODING + option or the current client encoding, and output data is encoded + in ENCODING or the current client encoding, even if the data does not pass through the client but is read from or written to a file directly by the server. -- cgit v1.2.3