aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorItagaki Takahiro <itagaki.takahiro@gmail.com>2011-02-21 14:08:04 +0900
committerItagaki Takahiro <itagaki.takahiro@gmail.com>2011-02-21 14:32:40 +0900
commit3cba8240a195c4f323e3f934bfeab308434a9973 (patch)
tree39c4641db5d73fb2ecb30a2807845aff53f3714c /doc/src
parent48d25bac9f024f36b43cbba58778adf9ad0207c6 (diff)
downloadpostgresql-3cba8240a195c4f323e3f934bfeab308434a9973.tar.gz
postgresql-3cba8240a195c4f323e3f934bfeab308434a9973.zip
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.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/file-fdw.sgml11
-rw-r--r--doc/src/sgml/ref/copy.sgml20
2 files changed, 28 insertions, 3 deletions
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 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><literal>encoding</literal></term>
+
+ <listitem>
+ <para>
+ Specifies the file's encoding.
+ the same as <command>COPY</>'s <literal>ENCODING</literal> option.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
<para>
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 { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
QUOTE '<replaceable class="parameter">quote_character</replaceable>'
ESCAPE '<replaceable class="parameter">escape_character</replaceable>'
FORCE_QUOTE { ( <replaceable class="parameter">column</replaceable> [, ...] ) | * }
- FORCE_NOT_NULL ( <replaceable class="parameter">column</replaceable> [, ...] )
+ FORCE_NOT_NULL ( <replaceable class="parameter">column</replaceable> [, ...] ) |
+ ENCODING '<replaceable class="parameter">encoding_name</replaceable>'
</synopsis>
</refsynopsisdiv>
@@ -282,6 +283,18 @@ COPY { <replaceable class="parameter">table_name</replaceable> [ ( <replaceable
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><literal>ENCODING</></term>
+ <listitem>
+ <para>
+ Specifies that the file is encoded in the <replaceable
+ class="parameter">encoding_name</replaceable>. If this option is
+ omitted, the current client encoding is used. See the Notes below
+ for more details.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</refsect1>
@@ -377,8 +390,9 @@ COPY <replaceable class="parameter">count</replaceable>
</para>
<para>
- 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 <literal>ENCODING</literal>
+ option or the current client encoding, and output data is encoded
+ in <literal>ENCODING</literal> 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.
</para>