Skip to content

Commit a21767e

Browse files
committed
411
1 parent 3bf6e38 commit a21767e

23 files changed

+5915
-2011
lines changed

postgresql/doc/src/sgml/pltcl.sgml

Lines changed: 487 additions & 102 deletions
Large diffs are not rendered by default.

postgresql/doc/src/sgml/postgres-fdw.sgml

Lines changed: 79 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,24 @@ ____________________________________________________________________________-->
685685
<para>
686686
注意除<literal>NOT NULL</>之外的约束将不会从远程表中导入。虽然<productname>PostgreSQL</>确实支持外部表上的<literal>CHECK</>约束,但不会自动导入它们,因为存在本地和远程服务器计算约束表达式方式不同的风险。<literal>CHECK</>约束中的任何这类不一致都可能导致查询优化中很难检测的错误。因此,如果你希望导入<literal>CHECK</>约束,你必须手工来做,并且你应该仔细地验证每一个这种约束的语义。有关处理外部表上<literal>CHECK</>约束的更多细节,请见<xref linkend="sql-createforeigntable">。
687687
</para>
688-
</sect3>
688+
689+
<!--==========================orignal english content==========================
690+
<para>
691+
Tables or foreign tables which are partitions of some other table are
692+
automatically excluded. Partitioned tables are imported, unless they
693+
are a partition of some other table. Since all data can be accessed
694+
through the partitioned table which is the root of the partitioning
695+
hierarchy, this approach should allow access to all the data without
696+
creating extra objects.
697+
</para>
698+
____________________________________________________________________________-->
699+
<para>
700+
自动排除作为其他表的分区的表或外部表。分区表被导入,除非它们是其他表的分区。
701+
由于所有数据都可以通过作为分区层次根的分区表来访问,
702+
所以这种方法应该允许访问所有数据而不创建额外的对象。
703+
</para>
704+
705+
</sect3>
689706
</sect2>
690707

691708
<sect2>
@@ -773,15 +790,20 @@ ____________________________________________________________________________-->
773790
<filename>postgres_fdw</> attempts to optimize the query execution by
774791
sending the whole query to the remote server if there are no query
775792
<literal>WHERE</> clauses that cannot be sent to the remote server,
776-
no local joins for the query, and no row-level local <literal>BEFORE</> or
777-
<literal>AFTER</> triggers on the target table. In <command>UPDATE</>,
793+
no local joins for the query, no row-level local <literal>BEFORE</> or
794+
<literal>AFTER</> triggers on the target table, and no
795+
<literal>CHECK OPTION</> constraints from parent views.
796+
In <command>UPDATE</>,
778797
expressions to assign to target columns must use only built-in data types,
779798
<literal>IMMUTABLE</> operators, or <literal>IMMUTABLE</> functions,
780799
to reduce the risk of misexecution of the query.
781800
</para>
782801
____________________________________________________________________________-->
783802
<para>
784-
<filename>postgres_fdw</>尝试优化远程查询来减少从外部服务器传来的数据量。这可以通过把查询的<literal>WHERE</>子句发送给远程服务器执行来完成,并且还可以不检索当前查询不需要的表列。为了降低查询被误执行的风险,除非<literal>WHERE</>子句使用的数据类型、操作符和函数都是内建的或者属于列在该外部服务器的<literal>extensions</>选项中的一个扩展,将不会把<literal>WHERE</>子句发送到远程服务器。这些子句中的操作符合函数也必须是<literal>IMMUTABLE</>。对于<command>UPDATE</>或者<command>DELETE</>查询,如果没有不能发送给远程服务器的<literal>WHERE</>子句、没有本地连接并且目标表上没有本地的行级<literal>BEFORE</>或<literal>AFTER</>触发器,<filename>postgres_fdw</>会尝试通过将整个查询发送给远程服务器来优化查询的执行。在<command>UPDATE</>中,赋值给目标列的表达式只能使用内建数据类型、<literal>IMMUTABLE</>操作符或者<literal>IMMUTABLE</>操作符,这样能降低查询被误执行的风险。
803+
<filename>postgres_fdw</>尝试优化远程查询来减少从外部服务器传来的数据量。这可以通过把查询的<literal>WHERE</>子句发送给远程服务器执行来完成,并且还可以不检索当前查询不需要的表列。为了降低查询被误执行的风险,除非<literal>WHERE</>子句使用的数据类型、操作符和函数都是内建的或者属于列在该外部服务器的<literal>extensions</>选项中的一个扩展,将不会把<literal>WHERE</>子句发送到远程服务器。这些子句中的操作符合函数也必须是<literal>IMMUTABLE</>。对于<command>UPDATE</>或者<command>DELETE</>查询,
804+
如果没有不能发送给远程服务器的<literal>WHERE</>子句、
805+
没有查询的本地连接、目标表上没有本地的行级<literal>BEFORE</>或<literal>AFTER</>触发器,
806+
并且没有来自父视图的<literal>CHECK OPTION</>约束,<filename>postgres_fdw</>会尝试通过将整个查询发送给远程服务器来优化查询的执行。在<command>UPDATE</>中,赋值给目标列的表达式只能使用内建数据类型、<literal>IMMUTABLE</>操作符或者<literal>IMMUTABLE</>操作符,这样能降低查询被误执行的风险。
785807
</para>
786808

787809
<!--==========================orignal english content==========================
@@ -840,17 +862,63 @@ ____________________________________________________________________________-->
840862
<!--==========================orignal english content==========================
841863
<para>
842864
<filename>postgres_fdw</> likewise establishes remote session settings
843-
for the parameters <xref linkend="guc-timezone">,
844-
<xref linkend="guc-datestyle">, <xref linkend="guc-intervalstyle">,
845-
and <xref linkend="guc-extra-float-digits">. These are less likely
846-
to be problematic than <varname>search_path</>, but can be handled
847-
with function <literal>SET</> options if the need arises.
865+
for various parameters:
866+
<itemizedlist spacing="compact">
867+
<listitem>
868+
<para>
869+
<xref linkend="guc-timezone"> is set to <literal>UTC</>
870+
</para>
871+
</listitem>
872+
<listitem>
873+
<para>
874+
<xref linkend="guc-datestyle"> is set to <literal>ISO</>
875+
</para>
876+
</listitem>
877+
<listitem>
878+
<para>
879+
<xref linkend="guc-intervalstyle"> is set to <literal>postgres</>
880+
</para>
881+
</listitem>
882+
<listitem>
883+
<para>
884+
<xref linkend="guc-extra-float-digits"> is set to <literal>3</> for remote
885+
servers 9.0 and newer and is set to <literal>2</> for older versions
886+
</para>
887+
</listitem>
888+
</itemizedlist>
889+
These are less likely to be problematic than <varname>search_path</>, but
890+
can be handled with function <literal>SET</> options if the need arises.
848891
</para>
849892
____________________________________________________________________________-->
850893
<para>
851-
<filename>postgres_fdw</>同样也为参数<xref linkend="guc-timezone">、<xref linkend="guc-datestyle">、<xref linkend="guc-intervalstyle">和<xref linkend="guc-extra-float-digits">建立远程会话设置。这些不如<varname>search_path</>有那么多问题,但是如果需要也可以使用函数<literal>SET</>选项来处理。
894+
<filename>postgres_fdw</>同样为各种参数建立远程会话设置:
895+
<itemizedlist spacing="compact">
896+
<listitem>
897+
<para>
898+
<xref linkend="guc-timezone">设置为<literal>UTC</>
899+
</para>
900+
</listitem>
901+
<listitem>
902+
<para>
903+
<xref linkend="guc-datestyle">设置为<literal>ISO</>
904+
</para>
905+
</listitem>
906+
<listitem>
907+
<para>
908+
<xref linkend="guc-intervalstyle">设置为<literal>postgres</>
909+
</para>
910+
</listitem>
911+
<listitem>
912+
<para>
913+
对于远程服务器9.0和更新版本,<xref linkend="guc-extra-float-digits">
914+
设置为<literal>3</>,并且针对更老版本设置为<literal>2</>
915+
</para>
916+
</listitem>
917+
</itemizedlist>
918+
这些不如<varname>search_path</>有那么多问题,但是如果需要也可以使用函数
919+
<literal>SET</>选项来处理。
852920
</para>
853-
921+
854922
<!--==========================orignal english content==========================
855923
<para>
856924
It is <emphasis>not</> recommended that you override this behavior by

postgresql/doc/src/sgml/problems.sgml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,13 @@ ____________________________________________________________________________-->
476476
<para>
477477
Another method is to fill in the bug report web-form available
478478
at the project's
479-
<ulink url="http://www.postgresql.org/">web site</ulink>.
479+
<ulink url="https://www.postgresql.org/">web site</ulink>.
480480
Entering a bug report this way causes it to be mailed to the
481481
<email>pgsql-bugs@postgresql.org</email> mailing list.
482482
</para>
483483
____________________________________________________________________________-->
484484
<para>
485-
另一种方法是填写项目<ulink url="http://www.postgresql.org/">网站</ulink>上的缺陷报告网页表格。以这种方式输入的缺陷报告会被发送到<email>pgsql-bugs@postgresql.org</email>邮件列表。
485+
另一种方法是填写项目<ulink url="https://www.postgresql.org/">网站</ulink>上的缺陷报告网页表格。以这种方式输入的缺陷报告会被发送到<email>pgsql-bugs@postgresql.org</email>邮件列表。
486486
</para>
487487

488488
<!--==========================orignal english content==========================

0 commit comments

Comments
 (0)