@@ -160,6 +160,19 @@ ____________________________________________________________________________-->
160
160
<literal>STDIN</literal>或者<literal>STDOUT</literal>时,数据会通过客
161
161
户端和服务器之间的连接传输。
162
162
</para>
163
+
164
+ <!--==========================orignal english content==========================
165
+ <para>
166
+ Each backend running <command>COPY</command> will report its progress
167
+ in the <structname>pg_stat_progress_copy</structname> view. See
168
+ <xref linkend="copy-progress-reporting"/> for details.
169
+ </para>
170
+ ____________________________________________________________________________-->
171
+ <para>
172
+ 运行<command>COPY</command>的每个后端将在
173
+ <structname>pg_stat_progress_copy</structname>视图中报告其进度。
174
+ 有关详细信息,请参见<xref linkend="copy-progress-reporting"/>。
175
+ </para>
163
176
</refsect1>
164
177
165
178
<refsect1>
@@ -213,17 +226,21 @@ ____________________________________________________________________________-->
213
226
<listitem>
214
227
<!--==========================orignal english content==========================
215
228
<para>
216
- A <xref linkend="sql-select"/>, <xref linkend="sql-values"/>,
217
- <xref linkend="sql-insert"/>, <xref linkend="sql-update"/> or
218
- <xref linkend="sql-delete"/> command whose results are to be
229
+ A <link linkend="sql-select"><command>SELECT</command></link>,
230
+ <link linkend="sql-values"><command>VALUES</command></link>,
231
+ <link linkend="sql-insert"><command>INSERT</command></link>,
232
+ <link linkend="sql-update"><command>UPDATE</command></link>, or
233
+ <link linkend="sql-delete"><command>DELETE</command></link> command whose results are to be
219
234
copied. Note that parentheses are required around the query.
220
235
</para>
221
236
____________________________________________________________________________-->
222
237
<para>
223
- 其结果要被复制的<xref linkend="sql-select"/>、
224
- <xref linkend="sql-values"/>、
225
- <xref linkend="sql-insert"/>、<xref linkend="sql-update"/>或者
226
- <xref linkend="sql-delete"/>命令。注意查询周围的圆括号是必要的。
238
+ 其结果要被复制的<link linkend="sql-select"><command>SELECT</command></link>、
239
+ <link linkend="sql-values"><command>VALUES</command></link>、
240
+ <link linkend="sql-insert"><command>INSERT</command></link>、
241
+ <link linkend="sql-update"><command>UPDATE</command></link>或者
242
+ <link linkend="sql-delete"><command>DELETE</command></link>命令。
243
+ 注意查询周围的圆括号是必要的。
227
244
</para>
228
245
<!--==========================orignal english content==========================
229
246
<para>
@@ -759,16 +776,25 @@ ____________________________________________________________________________-->
759
776
760
777
<!--==========================orignal english content==========================
761
778
<para>
762
- <command>COPY TO</command> can only be used with plain tables, not
763
- with views. However, you can write <literal>COPY (SELECT * FROM
764
- <replaceable class="parameter">viewname</replaceable>) TO ...</literal>
765
- to copy the current contents of a view.
779
+ <command>COPY TO</command> can be used only with plain
780
+ tables, not views, and does not copy rows from child tables
781
+ or child partitions. For example, <literal>COPY <replaceable
782
+ class="parameter">table</replaceable> TO</literal> copies
783
+ the same rows as <literal>SELECT * FROM ONLY <replaceable
784
+ class="parameter">table</replaceable></literal>.
785
+ The syntax <literal>COPY (SELECT * FROM <replaceable
786
+ class="parameter">table</replaceable>) TO ...</literal> can be used to
787
+ dump all of the rows in an inheritance hierarchy, partitioned table,
788
+ or view.
766
789
</para>
767
790
____________________________________________________________________________-->
768
791
<para>
769
- <command>COPY TO</command>只能被用于纯粹的表,不能用于视图。
770
- 不过你可以写<literal>COPY (SELECT * FROM
771
- <replaceable class="parameter">viewname</replaceable>) TO ...</literal>来拷贝一个视图的当前内容。
792
+ <command>COPY TO</command>只能用于普通表,而不能用于视图,并且不能从子表或子分区复制行。
793
+ 例如,<literal>COPY <replaceable class="parameter">table</replaceable> TO</literal>
794
+ 复制与<literal>SELECT * FROM ONLY <replaceable class="parameter">table</replaceable></literal>
795
+ 相同的行。
796
+ 语法<literal>COPY (SELECT * FROM <replaceable class="parameter">table</replaceable>) TO ...</literal>
797
+ 可用于转储一个继承层次结构、分区表或视图中的所有行。
772
798
</para>
773
799
774
800
<!--==========================orignal english content==========================
@@ -782,26 +808,6 @@ ____________________________________________________________________________-->
782
808
<command>COPY FROM</command>可以被用于普通表、外部表、分区表或者具有<literal>INSTEAD OF INSERT</literal>触发器的视图。
783
809
</para>
784
810
785
- <!--==========================orignal english content==========================
786
- <para>
787
- <command>COPY</command> only deals with the specific table named;
788
- it does not copy data to or from child tables. Thus for example
789
- <literal>COPY <replaceable class="parameter">table</replaceable> TO</literal>
790
- shows the same data as <literal>SELECT * FROM ONLY <replaceable
791
- class="parameter">table</replaceable></literal>. But <literal>COPY
792
- (SELECT * FROM <replaceable class="parameter">table</replaceable>) TO ...</literal>
793
- can be used to dump all of the data in an inheritance hierarchy.
794
- </para>
795
- ____________________________________________________________________________-->
796
- <para>
797
- <command>COPY</command>只处理提到的表,它不会从子表复制
798
- 数据或者复制数据到子表中。例如
799
- <literal>COPY <replaceable class="parameter">table</replaceable> TO</literal>
800
- 会显示与<literal>SELECT * FROM ONLY <replaceable
801
- class="parameter">table</replaceable></literal>相同的数据。而<literal>COPY
802
- (SELECT * FROM <replaceable class="parameter">table</replaceable>) TO ...</literal>
803
- 可以被用来转储一个继承层次中的所有数据。
804
- </para>
805
811
806
812
<!--==========================orignal english content==========================
807
813
<para>
@@ -845,7 +851,7 @@ ____________________________________________________________________________-->
845
851
by the server, not by the client application, must be executable by the
846
852
<productname>PostgreSQL</productname> user.
847
853
<command>COPY</command> naming a file or command is only allowed to
848
- database superusers or users who are granted one of the default roles
854
+ database superusers or users who are granted one of the roles
849
855
<literal>pg_read_server_files</literal>,
850
856
<literal>pg_write_server_files</literal>,
851
857
or <literal>pg_execute_server_program</literal>, since it allows reading
@@ -861,7 +867,9 @@ ____________________________________________________________________________-->
861
867
ID)可访问的并且是可读或者可写的。类似地,用<literal>PROGRAM</literal>
862
868
指定的命令也会由服务器(不是客户端应用)直接执行,它也必须是
863
869
<productname>PostgreSQL</productname>用户可以执行的。
864
- 只允许数据库超级用户或者授予了默认角色<literal>pg_read_server_files</literal>、<literal>pg_write_server_files</literal>及<literal>pg_execute_server_program</literal>之一的用户<command>COPY</command>一个文件或者命令,
870
+ 只允许数据库超级用户或者授予了角色<literal>pg_read_server_files</literal>、
871
+ <literal>pg_write_server_files</literal>及<literal>pg_execute_server_program</literal>
872
+ 之一的用户<command>COPY</command>一个文件或者命令,
865
873
因为它允许读取或者写入服务器有特权访问的任何文件或者运行服务器有特权访问的程序。
866
874
</para>
867
875
@@ -1149,12 +1157,12 @@ ____________________________________________________________________________-->
1149
1157
<row>
1150
1158
<entry><literal>\</literal><replaceable>digits</replaceable></entry>
1151
1159
<entry>Backslash followed by one to three octal digits specifies
1152
- the character with that numeric code</entry>
1160
+ the byte with that numeric code</entry>
1153
1161
</row>
1154
1162
<row>
1155
1163
<entry><literal>\x</literal><replaceable>digits</replaceable></entry>
1156
1164
<entry>Backslash <literal>x</literal> followed by one or two hex digits specifies
1157
- the character with that numeric code</entry>
1165
+ the byte with that numeric code</entry>
1158
1166
</row>
1159
1167
</tbody>
1160
1168
</tgroup>
@@ -1204,17 +1212,17 @@ ____________________________________________________________________________-->
1204
1212
</row>
1205
1213
<row>
1206
1214
<entry><literal>\</literal><replaceable>digits</replaceable></entry>
1207
- <entry>反斜线后跟一到三个十进制位表示该数字代码对应的字符 </entry>
1215
+ <entry>反斜线后跟一到三个八进制数字表示该数字代码对应的字节 </entry>
1208
1216
</row>
1209
1217
<row>
1210
1218
<entry><literal>\x</literal><replaceable>digits</replaceable></entry>
1211
- <entry>反斜线加<literal>x</literal>后跟一到三个十六进制位表示该数字代码对应的字符 </entry>
1219
+ <entry>反斜线加<literal>x</literal>后跟一到三个十六进制数字表示该数字代码对应的字节 </entry>
1212
1220
</row>
1213
1221
</tbody>
1214
1222
</tgroup>
1215
1223
</informaltable>
1216
1224
1217
- 当前,<command>COPY TO</command>不会发出一个十进制或十六进制位
1225
+ 当前,<command>COPY TO</command>不会发出一个八进制或十六进制位
1218
1226
反斜线序列,但是它确实把上面列出的其他序列用于那些控制字符。
1219
1227
</para>
1220
1228
@@ -1256,6 +1264,17 @@ ____________________________________________________________________________-->
1256
1264
传输<command>COPY</command>文件,它们也很容易受到破坏。
1257
1265
</para>
1258
1266
1267
+ <!--==========================orignal english content==========================
1268
+ <para>
1269
+ All backslash sequences are interpreted after encoding conversion.
1270
+ The bytes specified with the octal and hex-digit backslash sequences must
1271
+ form valid characters in the database encoding.
1272
+ </para>
1273
+ ____________________________________________________________________________-->
1274
+ <para>
1275
+ 所有反斜杠序列都在编码转换后进行解释。
1276
+ 用八进制和十六进制数字反斜杠序列指定的字节必须在数据库编码中形成有效字符。
1277
+ </para>
1259
1278
<!--==========================orignal english content==========================
1260
1279
<para>
1261
1280
<command>COPY TO</command> will terminate each row with a Unix-style
@@ -2000,4 +2019,15 @@ COPY [ BINARY ] <replaceable class="parameter">table_name</replaceable>
2000
2019
[ WITH NULL AS '<replaceable class="parameter">null_string</replaceable>' ]
2001
2020
</synopsis></para>
2002
2021
</refsect1>
2022
+
2023
+ <refsect1>
2024
+ <!--==========================orignal english content==========================
2025
+ <title>See Also</title>
2026
+ ____________________________________________________________________________-->
2027
+ <title>另见</title>
2028
+
2029
+ <simplelist type="inline">
2030
+ <member><xref linkend="copy-progress-reporting"/></member>
2031
+ </simplelist>
2032
+ </refsect1>
2003
2033
</refentry>
0 commit comments