Skip to content

Commit f68fb38

Browse files
committed
Update create_table.sgml
ref/create_table.sgml调整内容记录 2019.12.20 1. row6———————————————— 根据WinMerge比较结果,将 "<refentry id="SQL-CREATETABLE">" 调整为小写 "<refentry id="sql-createtable">" 2. row50———————————————— 根据WinMerge比较结果,将 "[ PARTITION BY { RANGE | LIST } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]" 调整为新内容 "[ PARTITION BY { RANGE | LIST | HASH } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]" 3.row130 根据row50英文内容更新,将 "[ PARTITION BY { RANGE | LIST } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]" 调整为新翻译内容 "[ PARTITION BY { RANGE | LIST | HASH } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]" 3. row61———————————————— 根据WinMerge比较结果,将 "[ PARTITION BY { RANGE | LIST } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]" 调整为新内容 "[ PARTITION BY { RANGE | LIST | HASH } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]" row141 根据row61英文内容更新,将 "[ PARTITION BY { RANGE | LIST } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]" 调整为新翻译内容 "[ PARTITION BY { RANGE | LIST | HASH } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]" 4. row71———————————————— 根据WinMerge比较结果,将 “) ] FOR VALUES <replaceable class="parameter">partition_bound_spec</replaceable> [ PARTITION BY { RANGE | LIST } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]” 调整为新内容 ") ] { FOR VALUES <replaceable class="parameter">partition_bound_spec</replaceable> | DEFAULT } [ PARTITION BY { RANGE | LIST | HASH } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]" row151 根据row71英文内容更新,将 “) ] FOR VALUES <replaceable class="parameter">partition_bound_spec</replaceable> [ PARTITION BY { RANGE | LIST } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]” 调整为新翻译内容 ") ] { FOR VALUES <replaceable class="parameter">partition_bound_spec</replaceable> | DEFAULT } [ PARTITION BY { RANGE | LIST | HASH } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ COLLATE <replaceable class="parameter">collation</replaceable> ] [ <replaceable class="parameter">opclass</replaceable> ] [, ... ] ) ]" 5. row104———————————————— 根据WinMerge比较结果,将 "{ INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | IDENTITY | INDEXES | STORAGE | COMMENTS | ALL }" 调整为新内容 "{ INCLUDING | EXCLUDING } { COMMENTS | CONSTRAINTS | DEFAULTS | IDENTITY | INDEXES | STATISTICS | STORAGE | ALL }" row184 根据row104英文内容更新,将 "{ INCLUDING | EXCLUDING } { DEFAULTS | CONSTRAINTS | IDENTITY | INDEXES | STORAGE | COMMENTS | ALL }" 调整为新翻译内容 "{ INCLUDING | EXCLUDING } { COMMENTS | CONSTRAINTS | DEFAULTS | IDENTITY | INDEXES | STATISTICS | STORAGE | ALL }" 6. row108———————————————— 根据WinMerge比较结果,将 IN ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | NULL } [, ...] ) | FROM ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | MINVALUE | MAXVALUE } [, ...] ) TO ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | MINVALUE | MAXVALUE } [, ...] ) 调整为新内容 IN ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | TRUE | FALSE | NULL } [, ...] ) | FROM ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | TRUE | FALSE | MINVALUE | MAXVALUE } [, ...] ) TO ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | TRUE | FALSE | MINVALUE | MAXVALUE } [, ...] ) | WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REMAINDER <replaceable class="parameter">numeric_literal</replaceable> ) 8.row189 根据row108英文内容更新,将 IN ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | NULL } [, ...] ) | FROM ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | MINVALUE | MAXVALUE } [, ...] ) TO ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | MINVALUE | MAXVALUE } [, ...] ) 调整为新翻译内容 IN ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | TRUE | FALSE | NULL } [, ...] ) | FROM ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | TRUE | FALSE | MINVALUE | MAXVALUE } [, ...] ) TO ( { <replaceable class="parameter">numeric_literal</replaceable> | <replaceable class="parameter">string_literal</replaceable> | TRUE | FALSE | MINVALUE | MAXVALUE } [, ...] ) | WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REMAINDER <replaceable class="parameter">numeric_literal</replaceable> ) 7. row115———————————————— 根据row108英文内容更新,将 空行 调整为新内容 [ INCLUDE ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) ] row197 根据row115英文内容更新,将 空行 调整为新翻译内容 [ INCLUDE ( <replaceable class="parameter">column_name</replaceable> [, ... ] ) ] 8. row208———————————————— 根据WinMerge比较结果,将 " <refsect1 id="SQL-CREATETABLE-description">" 调整为小写 "<refsect1 id="sql-createtable-description">" 9. row299———————————————— 根据WinMerge比较结果,将 " <varlistentry id="SQL-CREATETABLE-TEMPORARY">" 调整为小写 "<varlistentry id="sql-createtable-temporary">" 10. row351———————————————— 根据WinMerge比较结果,将 " <varlistentry id="SQL-CREATETABLE-UNLOGGED">" 调整为小写 "<varlistentry id="sql-createtable-unlogged">" 11. row445 to row713———————————————— 根据WinMerge比较结果,将 <varlistentry id="SQL-CREATETABLE-PARTITION"> <term><literal>PARTITION OF <replaceable class="parameter">parent_table</replaceable> FOR VALUES <replaceable class="parameter">partition_bound_spec</replaceable></literal></term> 调整为新内容 并且更新相应翻译内容 <varlistentry> <term><replaceable class="parameter">column_name</replaceable></term> <listitem> <para> The name of a column to be created in the new table. </para> </listitem> </varlistentry> <varlistentry> <term><replaceable class="parameter">data_type</replaceable></term> <listitem> <para> The data type of the column. This can include array specifiers. For more information on the data types supported by <productname>PostgreSQL</productname>, refer to <xref linkend="datatype"/>. </para> </listitem> </varlistentry> <varlistentry> <term><literal>COLLATE <replaceable>collation</replaceable></literal></term> <listitem> <para> The <literal>COLLATE</literal> clause assigns a collation to the column (which must be of a collatable data type). If not specified, the column data type's default collation is used. </para> </listitem> </varlistentry> <varlistentry> <term><literal>INHERITS ( <replaceable>parent_table</replaceable> [, ... ] )</literal></term> <listitem> <para> The optional <literal>INHERITS</literal> clause specifies a list of tables from which the new table automatically inherits all columns. Parent tables can be plain tables or foreign tables. </para> <para> Use of <literal>INHERITS</literal> creates a persistent relationship between the new child table and its parent table(s). Schema modifications to the parent(s) normally propagate to children as well, and by default the data of the child table is included in scans of the parent(s). </para> <para> If the same column name exists in more than one parent table, an error is reported unless the data types of the columns match in each of the parent tables. If there is no conflict, then the duplicate columns are merged to form a single column in the new table. If the column name list of the new table contains a column name that is also inherited, the data type must likewise match the inherited column(s), and the column definitions are merged into one. If the new table explicitly specifies a default value for the column, this default overrides any defaults from inherited declarations of the column. Otherwise, any parents that specify default values for the column must all specify the same default, or an error will be reported. </para> <para> <literal>CHECK</literal> constraints are merged in essentially the same way as columns: if multiple parent tables and/or the new table definition contain identically-named <literal>CHECK</literal> constraints, these constraints must all have the same check expression, or an error will be reported. Constraints having the same name and expression will be merged into one copy. A constraint marked <literal>NO INHERIT</literal> in a parent will not be considered. Notice that an unnamed <literal>CHECK</literal> constraint in the new table will never be merged, since a unique name will always be chosen for it. </para> <para> Column <literal>STORAGE</literal> settings are also copied from parent tables. </para> <para> If a column in the parent table is an identity column, that property is not inherited. A column in the child table can be declared identity column if desired. </para> </listitem> </varlistentry> <varlistentry> <term><literal>PARTITION BY { RANGE | LIST | HASH } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ <replaceable class="parameter">opclass</replaceable> ] [, ...] ) </literal></term> <listitem> <para> The optional <literal>PARTITION BY</literal> clause specifies a strategy of partitioning the table. The table thus created is called a <firstterm>partitioned</firstterm> table. The parenthesized list of columns or expressions forms the <firstterm>partition key</firstterm> for the table. When using range or hash partitioning, the partition key can include multiple columns or expressions (up to 32, but this limit can be altered when building <productname>PostgreSQL</productname>), but for list partitioning, the partition key must consist of a single column or expression. </para> <para> Range and list partitioning require a btree operator class, while hash partitioning requires a hash operator class. If no operator class is specified explicitly, the default operator class of the appropriate type will be used; if no default operator class exists, an error will be raised. When hash partitioning is used, the operator class used must implement support function 2 (see <xref linkend="xindex-support"/> for details). </para> <para> A partitioned table is divided into sub-tables (called partitions), which are created using separate <literal>CREATE TABLE</literal> commands. The partitioned table is itself empty. A data row inserted into the table is routed to a partition based on the value of columns or expressions in the partition key. If no existing partition matches the values in the new row, an error will be reported. </para> <para> Partitioned tables do not support <literal>EXCLUDE</literal> constraints; however, you can define these constraints on individual partitions. Also, while it's possible to define <literal>PRIMARY KEY</literal> constraints on partitioned tables, creating foreign keys that reference a partitioned table is not yet supported. </para> <para> See <xref linkend="ddl-partitioning"/> for more discussion on table partitioning. </para> </listitem> </varlistentry> <varlistentry id="sql-createtable-partition"> <term><literal>PARTITION OF <replaceable class="parameter">parent_table</replaceable> { FOR VALUES <replaceable class="parameter">partition_bound_spec</replaceable> | DEFAULT }</literal></term> 12. row 719 to 729———————————————— 根据WinMerge比较结果,将 “parent table.” 调整为新内容,并且更新相应翻译内容 parent table. The table can be created either as a partition for specific values using <literal>FOR VALUES</literal> or as a default partition using <literal>DEFAULT</literal>. This option is not available for hash-partitioned tables. 13. row 738 to 749———————————————— 根据WinMerge比较结果,将 while the form with <literal>FROM</literal> and <literal>TO</literal> is used for range partitioning. 调整为新内容,并且更新相应翻译内容 the form with <literal>FROM</literal> and <literal>TO</literal> is used for range partitioning, and the form with <literal>WITH</literal> is used for hash partitioning. 14. row 889 to 959———————————————— 根据WinMerge比较结果, 增加V11.2版本中的新内容,并更新相应翻译内容 <!--==========================orignal english content========================== <para> If <literal>DEFAULT</literal> is specified, the table will be created as a default partition of the parent table. The parent can either be a list or range partitioned table. A partition key value not fitting into any other partition of the given parent will be routed to the default partition. There can be only one default partition for a given parent table. </para> ____________________________________________________________________________--> <para> 如果指定了<literal>DEFAULT</literal>,则表将创建为父表的默认分区。 父级表可以是列表或范围分区表。 不适合给定父级表的任何其他分区的分区键值将路由到默认分区。 给定父级表只能有一个默认分区。 </para> <!--==========================orignal english content========================== <para> When a table has an existing <literal>DEFAULT</literal> partition and a new partition is added to it, the existing default partition must be scanned to verify that it does not contain any rows which properly belong in the new partition. If the default partition contains a large number of rows, this may be slow. The scan will be skipped if the default partition is a foreign table or if it has a constraint which proves that it cannot contain rows which should be placed in the new partition. </para> ____________________________________________________________________________--> <para> 当一个表已有<literal>DEFAULT</literal> 分区并且要对它添加新分区时, 必须扫描现有的默认分区以验证它不包含可能属于新分区的任何行。 如果默认分区包含大量行,则速度可能会很慢。 如果默认分区是外表或者它具有可证明的不可能包含能放置在新分区中的行的约束,则将略过扫描 </para> <!--==========================orignal english content========================== <para> When creating a hash partition, a modulus and remainder must be specified. The modulus must be a positive integer, and the remainder must be a non-negative integer less than the modulus. Typically, when initially setting up a hash-partitioned table, you should choose a modulus equal to the number of partitions and assign every table the same modulus and a different remainder (see examples, below). However, it is not required that every partition have the same modulus, only that every modulus which occurs among the partitions of a hash-partitioned table is a factor of the next larger modulus. This allows the number of partitions to be increased incrementally without needing to move all the data at once. For example, suppose you have a hash-partitioned table with 8 partitions, each of which has modulus 8, but find it necessary to increase the number of partitions to 16. You can detach one of the modulus-8 partitions, create two new modulus-16 partitions covering the same portion of the key space (one with a remainder equal to the remainder of the detached partition, and the other with a remainder equal to that value plus 8), and repopulate them with data. You can then repeat this -- perhaps at a later time -- for each modulus-8 partition until none remain. While this may still involve a large amount of data movement at each step, it is still better than having to create a whole new table and move all the data at once. </para> ____________________________________________________________________________--> <para> 当创建哈希分区时,必须指定模数和余数。 模数必须是正整数,余数必须是小于模数的非负整数。 通常情况下,当初始设置哈希分区表时,应选择一个与分区数相等的模数,并为每个表分配相同的模数和不同的余数(请参阅下方示例)。 不过,并不要求每个分区都具有相同的模数,只要求哈希分区表里面的分区中出现的每个模数都是下一个较大模数的因数。 这允许以增量的方式增加分区数量而不需要一次移动所有数据。 例如,假设你有一个包含 8 个分区的哈希分区表,每个分区有模数8,但发现有必要将分区数增加到 16 个。 您可以拆分其中一个模数-8分区,然后创建两个新的模数-16分区来覆盖键空间的相同部分(一个的余数等于被拆分的分区的余数,另一个的余数等于该值加 8),而后用数据重新填充他们。 然后,你可以对每一个余数-8分区重复此操作过程,直到没有剩余。 虽然这其中的每个步骤都可能会导致大量的数据移动操作,它仍然要好于建一个全新的表并一次移动全部数据。 </para> 15. row 990 to 995———————————————— 根据WinMerge比较结果, 将下述内容删除,并删除相应中文翻译。 Also, if updating a row in a given partition would require it to move to another partition due to new partition key values, an error will occur. 16. row 1030———————————————— 根据WinMerge比较结果,将原有1031-1222之间内容和翻译内容全部删除。 <varlistentry> <!--==========================orignal english content========================== <term><replaceable class="parameter">data_type</replaceable></term> ____________________________________________________________________________--> <term><replaceable class="parameter">data_type</replaceable></term> <listitem> <!--==========================orignal english content========================== <para> The data type of the column. This can include array specifiers. For more information on the data types supported by <productname>PostgreSQL</productname>, refer to <xref linkend="datatype">. </para> ____________________________________________________________________________--> <para> 该列的数据类型。这可以包括数组说明符。更多关于<productname>PostgreSQL</productname>支持的数据类型,请参考<xref linkend="datatype"/>。 </para> </listitem> </varlistentry> <varlistentry> <!--==========================orignal english content========================== <term><literal>COLLATE <replaceable>collation</replaceable></literal></term> ____________________________________________________________________________--> <term><literal>COLLATE <replaceable>collation</replaceable></literal></term> <listitem> <!--==========================orignal english content========================== <para> The <literal>COLLATE</> clause assigns a collation to the column (which must be of a collatable data type). If not specified, the column data type's default collation is used. </para> ____________________________________________________________________________--> <para> <literal>COLLATE</literal>子句为该列(必须是一种可排序数据类型)赋予一个排序规则。如果没有指定,将使用该列数据类型的默认排序规则。 </para> </listitem> </varlistentry> <varlistentry> <!--==========================orignal english content========================== <term><literal>INHERITS ( <replaceable>parent_table</replaceable> [, ... ] )</literal></term> ____________________________________________________________________________--> <term><literal>INHERITS ( <replaceable>parent_table</replaceable> [, ... ] )</literal></term> <listitem> <!--==========================orignal english content========================== <para> The optional <literal>INHERITS</> clause specifies a list of tables from which the new table automatically inherits all columns. Parent tables can be plain tables or foreign tables. </para> ____________________________________________________________________________--> <para> 可选的<literal>INHERITS</literal>子句指定一个表的列表,新表将从其中自动地继承所有列。父表可以是普通表或者外部表。 </para> <!--==========================orignal english content========================== <para> Use of <literal>INHERITS</> creates a persistent relationship between the new child table and its parent table(s). Schema modifications to the parent(s) normally propagate to children as well, and by default the data of the child table is included in scans of the parent(s). </para> ____________________________________________________________________________--> <para> <literal>INHERITS</literal>的使用在新的子表和它的父表之间创建一种持久的关系。对于父表的模式修改通常也会传播到子表,并且默认情况下子表的数据会被包括在对父表的扫描中。 </para> <!--==========================orignal english content========================== <para> If the same column name exists in more than one parent table, an error is reported unless the data types of the columns match in each of the parent tables. If there is no conflict, then the duplicate columns are merged to form a single column in the new table. If the column name list of the new table contains a column name that is also inherited, the data type must likewise match the inherited column(s), and the column definitions are merged into one. If the new table explicitly specifies a default value for the column, this default overrides any defaults from inherited declarations of the column. Otherwise, any parents that specify default values for the column must all specify the same default, or an error will be reported. </para> ____________________________________________________________________________--> <para> 如果在多个父表中存在同名的列,除非父表中每一个这种列的数据类型都能匹配,否则会报告一个错误。如果没有冲突,那么重复列会被融合来形成新表中的一个单一列。如果新表中的列名列表包含一个也是继承而来的列名,该数据类型必须也匹配继承的列,并且列定义会被融合成一个。如果新表显式地为列指定了任何默认值,这个默认值将覆盖来自该列继承声明中的默认值。否则,任何父表都必须为该列指定相同的默认值,或者会报告一个错误。 </para> <!--==========================orignal english content========================== <para> <literal>CHECK</> constraints are merged in essentially the same way as columns: if multiple parent tables and/or the new table definition contain identically-named <literal>CHECK</> constraints, these constraints must all have the same check expression, or an error will be reported. Constraints having the same name and expression will be merged into one copy. A constraint marked <literal>NO INHERIT</> in a parent will not be considered. Notice that an unnamed <literal>CHECK</> constraint in the new table will never be merged, since a unique name will always be chosen for it. </para> ____________________________________________________________________________--> <para> <literal>CHECK</literal>约束本质上也采用和列相同的方式被融合:如果多个父表或者新表定义中包含相同的命名<literal>CHECK</literal>约束,这些约束必须全部具有相同的检查表达式,否则将报告一个错误。具有相同名称和表达式的约束将被融合成一份拷贝。一个父表中的被标记为<literal>NO INHERIT</literal>的约束将不会被考虑。注意新表中一个未命名的<literal>CHECK</literal>约束将永远不会被融合,因为那样总是会为它选择一个唯一的名字。 </para> <!--==========================orignal english content========================== <para> Column <literal>STORAGE</> settings are also copied from parent tables. </para> ____________________________________________________________________________--> <para> 列的<literal>STORAGE</literal>设置也会从父表复制过来。 </para> <!--==========================orignal english content========================== <para> If a column in the parent table is an identity column, that property is not inherited. A column in the child table can be declared identity column if desired. </para> ____________________________________________________________________________--> <para> 如果父表中的列是标识列,那么该属性不会被继承。如果需要, 可以将子表中的列声明为标识列。 </para> </listitem> </varlistentry> <varlistentry> <!--==========================orignal english content========================== <term><literal>PARTITION BY { RANGE | LIST } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ <replaceable class="parameter">opclass</replaceable> ] [, ...] ) </literal></term> ____________________________________________________________________________--> <term><literal>PARTITION BY { RANGE | LIST } ( { <replaceable class="parameter">column_name</replaceable> | ( <replaceable class="parameter">expression</replaceable> ) } [ <replaceable class="parameter">opclass</replaceable> ] [, ...] ) </literal></term> <listitem> <!--==========================orignal english content========================== <para> The optional <literal>PARTITION BY</literal> clause specifies a strategy of partitioning the table. The table thus created is called a <firstterm>partitioned</firstterm> table. The parenthesized list of columns or expressions forms the <firstterm>partition key</firstterm> for the table. When using range partitioning, the partition key can include multiple columns or expressions (up to 32, but this limit can be altered when building <productname>PostgreSQL</productname>), but for list partitioning, the partition key must consist of a single column or expression. If no B-tree operator class is specified when creating a partitioned table, the default B-tree operator class for the datatype will be used. If there is none, an error will be reported. </para> ____________________________________________________________________________--> <para> 可选的<literal>PARTITION BY</literal>子句指定了对表进行分区的策略。 这样创建的表称为<firstterm>分区</firstterm>表。 带括号的列或表达式列表形成表的<firstterm>分区键</firstterm>。 使用范围分区时,分区键可以包含多个列或表达式(最多32个,但在构建 <productname>PostgreSQL</productname>时可以更改此限制),但对于列表分区, 分区键必须由单个列或表达式组成。如果在创建分区表时未指定B树操作符类, 则将使用该数据类型的默认B树操作符类。如果没有,则会报告错误。 </para> <!--==========================orignal english content========================== <para> A partitioned table is divided into sub-tables (called partitions), which are created using separate <literal>CREATE TABLE</> commands. The partitioned table is itself empty. A data row inserted into the table is routed to a partition based on the value of columns or expressions in the partition key. If no existing partition matches the values in the new row, an error will be reported. </para> ____________________________________________________________________________--> <para> 分区表被分成多个子表(称为分区),它们是使用单独的<literal>CREATE TABLE</literal>命令创建的。 分区表本身是空的。插入到表中的数据行将根据分区键中的列或表达式的值路由到分区。 如果没有现有的分区与新行中的值匹配,则会报告错误。 </para> <!--==========================orignal english content========================== <para> Partitioned tables do not support <literal>UNIQUE</literal>, <literal>PRIMARY KEY</literal>, <literal>EXCLUDE</literal>, or <literal>FOREIGN KEY</literal> constraints; however, you can define these constraints on individual partitions. </para> ____________________________________________________________________________--> <para> 分区表不支持<literal>UNIQUE</literal>、 <literal>PRIMARY KEY</literal>、<literal>EXCLUDE</literal>或 <literal>FOREIGN KEY</literal>约束;不过,可以在单个分区中定义这些约束。 </para> </listitem> </varlistentry> 17. row 1098 to 1108———————————————— 根据WinMerge比较结果,增加新内容,并更新相应翻译内容 <!--==========================orignal english content========================== <para> Extended statistics are copied to the new table if <literal>INCLUDING STATISTICS</literal> is specified. </para> ____________________________________________________________________________--> <para> Extended statistics are copied to the new table if <literal>INCLUDING STATISTICS</literal> is specified. 如果指定了<literal>INCLUDING STATISTICS</literal>,那么扩展统计会被复制到新表。 </para> 18. row 1150 to 1154———————————————— 根据WinMerge比较结果,将原有内容更新,翻译内容更新。 <literal>INCLUDING COMMENTS INCLUDING CONSTRAINTS INCLUDING DEFAULTS INCLUDING IDENTITY INCLUDING INDEXES INCLUDING STATISTICS INCLUDING STORAGE</literal>. </para> ____________________________________________________________________________--> <para><literal>INCLUDING ALL</literal>是 <literal>INCLUDING COMMENTS INCLUDING CONSTRAINTS INCLUDING DEFAULTS INCLUDING IDENTITY INCLUDING INDEXES INCLUDING STATISTICS INCLUDING STORAGE</literal>.的简写形式。 19. row 1406 to 1410———————————————— 根据WinMerge比较结果,将原有内容,翻译内容 <term><literal>UNIQUE ( <replaceable class="parameter">column_name</replaceable> [, ... ] )</> (table constraint)</term> ____________________________________________________________________________--> <term><literal>UNIQUE ( <replaceable class="parameter">column_name</replaceable> [, ... ] )</literal> (表约束)</term> 更新为新的内容如下。 <term><literal>UNIQUE ( <replaceable class="parameter">column_name</replaceable> [, ... ] )</literal> <optional> INCLUDE ( <replaceable class="parameter">column_name</replaceable> [, ...]) </optional> (table constraint)</term> ____________________________________________________________________________--> <term><literal>UNIQUE ( <replaceable class="parameter">column_name</replaceable> [, ... ] )</literal> <optional> INCLUDE ( <replaceable class="parameter">column_name</replaceable> [, ...]) </optional> (表约束)</term> 20. row 1448 to 1483———————————————— 根据WinMerge比较结果,增加新内容以及相应的翻译内容 <!--==========================orignal english content========================== <para> When establishing a unique constraint for a multi-level partition hierarchy, all the columns in the partition key of the target partitioned table, as well as those of all its descendant partitioned tables, must be included in the constraint definition. </para> ____________________________________________________________________________--> <para> When establishing a unique constraint for a multi-level partition hierarchy,all the columns in the partition key of the target partitioned table, as well as those of all its descendant partitioned tables, must be included in the constraint definition. 在为多级分区层次结构建立唯一约束时, 目标分区表的分区键中的所有列,以及那些由它派生的所有分区表, 必须被包含在约束定义中。 </para> <!--==========================orignal english content========================== <para> Adding a unique constraint will automatically create a unique btree index on the column or group of columns used in the constraint. The optional clause <literal>INCLUDE</literal> adds to that index one or more columns on which the uniqueness is not enforced. Note that although the constraint is not enforced on the included columns, it still depends on them. Consequently, some operations on these columns (e.g. <literal>DROP COLUMN</literal>) can cause cascaded constraint and index deletion. </para> ____________________________________________________________________________--> <para> 添加唯一约束将自动在使用于约束的列或列组上创建唯一的 btree索引。 可选子句 <literal>INCLUDE</literal>在不强制唯一性的情况下向该索引添加一个或多个列。 请注意虽然约束在包含的列上是非强制的,但是它仍然依赖于它们。 因此,这些列上的某些操作(例如<literal>DROP COLUMN</literal>)可能会导致级联约束和索引删除。 </para> 21. row 1494 to 1498———————————————— 根据WinMerge比较结果,将原有内容及翻译内容 <!--==========================orignal english content========================== <term><literal>PRIMARY KEY ( <replaceable class="parameter">column_name</replaceable> [, ... ] )</> (table constraint)</term> ____________________________________________________________________________--> <term><literal>PRIMARY KEY ( <replaceable class="parameter">column_name</replaceable> [, ... ] )</literal> (表约束)</term> <listitem> 更新为新内容及翻译内容 <term><literal>PRIMARY KEY ( <replaceable class="parameter">column_name</replaceable> [, ... ] )</literal> <optional> INCLUDE ( <replaceable class="parameter">column_name</replaceable> [, ...]) </optional> (table constraint)</term> ____________________________________________________________________________--> <term><literal>PRIMARY KEY ( <replaceable class="parameter">column_name</replaceable> [, ... ] )</literal> <optional> INCLUDE ( <replaceable class="parameter">column_name</replaceable> [, ...]) </optional> (表约束)</term> 22. row 1538 to 1566———————————————— 根据WinMerge比较结果,增加新内容以及相应的翻译内容 <!--==========================orignal english content========================== <para> <literal>PRIMARY KEY</literal> constraints share the restrictions that <literal>UNIQUE</literal> constraints have when placed on partitioned tables. </para> ____________________________________________________________________________--> <para> <literal>PRIMARY KEY</literal> 约束共享<literal>UNIQUE</literal> 约束放到分区表上时限制。 </para> <!--==========================orignal english content========================== <para> Adding a <literal>PRIMARY KEY</literal> constraint will automatically create a unique btree index on the column or group of columns used in the constraint. The optional <literal>INCLUDE</literal> clause allows a list of columns to be specified which will be included in the non-key portion of the index. Although uniqueness is not enforced on the included columns, the constraint still depends on them. Consequently, some operations on the included columns (e.g. <literal>DROP COLUMN</literal>) can cause cascaded constraint and index deletion. </para> ____________________________________________________________________________--> <para> 添加<literal>PRIMARY KEY</literal>约束将自动在用于约束的列或列组上创建唯一的 btree 索引。 可选的<literal>INCLUDE</literal> 子句允许指定将被包含在索引的非-键部分中的列的列表。 虽然包含的列的唯一性是非强制的,但约束仍依赖于它们。 因此,这些包含的列上的某些操作(例如<literal>DROP COLUMN</literal>)可能会导致级联约束和索引删除。 </para> 23. row 1570———————————————— 根据WinMerge比较结果,将 <varlistentry id="SQL-CREATETABLE-EXCLUDE"> 更新为小写 <varlistentry id="sql-createtable-exclude"> 24. row 1676 to 1678 ———————————————— 根据WinMerge比较结果,将 (either the whole table, or the specific referenced columns). 更新为如下内容 (either the whole table, or the specific referenced columns). The addition of a foreign key constraint requires a <literal>SHARE ROW EXCLUSIVE</literal> lock on the referenced table. Row1689-1690, 根据row 1676 to 1678变化,更新相应翻译内容 用户必须在被引用的表(或整个表,或特定的引用列)上拥有<literal>REFERENCES</literal>权限。 增加的外键约束需要<literal>SHARE ROW EXCLUSIVE</literal> 锁定引用的表。 25. row 1680 to1682 ———————————————— 根据WinMerge比较结果,将 tables and permanent tables. 调整为新内容 tables and permanent tables. Also note that while it is possible to define a foreign key on a partitioned table, it is not possible to declare a foreign key that references a partitioned table. Row 1692 根据row 1680 to1682内容变化,更新翻译内容 此外请注意,虽然可以在分区表上定义外键,但不能够声明引用分区表的外键。 26. row 2029 to 2031 ———————————————— 根据WinMerge比较结果,将 linkend="sql-truncate"> is done at each commit. 更新为 linkend="sql-truncate"/> is done at each commit. When used on a partitioned table, this is not cascaded to its partitions. row 2066 根据row 2029 to 2031更新内容,增加相应翻译内容 ”当应用于分区表上时,这不会级联到它的分区。“ 27. row 2041 to 2043 ———————————————— 根据WinMerge比较结果,将 transaction block. 更新为 transaction block. When used on a partitioned table, this action drops its partitions and when used on tables with inheritance children, it drops the dependent children. row 2078 根据row 2041 to 2043 内容的变化,增加翻译内容 ”当在分区表上使用时,这个操作会删除他的分区,在具有继承子级的表上使用时,它将删除依赖的子级。“ 28. row 2131 to 2135 ———————————————— 根据WinMerge比较结果,将 <refsect2 id="SQL-CREATETABLE-storage-parameters"> <title id="SQL-CREATETABLE-storage-parameters-title">Storage Parameters</title> 改为小写,并调整相应翻译内容 <refsect2 id="sql-createtable-storage-parameters"> <!--==========================orignal english content========================== <title id="sql-createtable-storage-parameters-title">Storage Parameters</title> ____________________________________________________________________________--> <title id="sql-createtable-storage-parameters-title">存储参数</title> 29. row 2152 ———————————————— 根据WinMerge比较结果,将 indexes are documented in <xref linkend="SQL-CREATEINDEX">. 改为小写 indexes are documented in <xref linkend="sql-createindex"/>. row 2168 根据row 2152改变内容,将翻译内容更改为小写 ”用于索引的存储参数已经在<xref linkend="sql-createindex"/>中介绍过。“ 30. row 2205 to 2237 ———————————————— 根据WinMerge比较结果,增加新内容和相应翻译如下 <!--==========================orignal english content========================== <term><literal>toast_tuple_target</literal> (<type>integer</type>)</term> ____________________________________________________________________________--> <term><literal>toast_tuple_target</literal> (<type>integer</type>)</term> <listitem> <!--==========================orignal english content========================== <para> The toast_tuple_target specifies the minimum tuple length required before we try to move long column values into TOAST tables, and is also the target length we try to reduce the length below once toasting begins. This only affects columns marked as either External or Extended and applies only to new tuples - there is no effect on existing rows. By default this parameter is set to allow at least 4 tuples per block, which with the default blocksize will be 2040 bytes. Valid values are between 128 bytes and the (blocksize - header), by default 8160 bytes. Changing this value may not be useful for very short or very long rows. Note that the default setting is often close to optimal, and it is possible that setting this parameter could have negative effects in some cases. This parameter cannot be set for TOAST tables. </para> ____________________________________________________________________________--> <para> 在我们尝试将长列值移动到TOAST表中之前,toast_tuple_target指定需要的最小元组长度, 也是在toasting开始时尝试减少长度的目标长度。 这仅影响标记为"外部"或"扩展"的列,并且仅适用于新元数 - 对现有行没有影响。 默认情况下此参数设置为允许每个块至少 4 个元组,默认块大小为 2040 字节。 有效值介于 128 字节和(块大小-标头)之间,默认大小为 8160 字节。 更改此值对于非常短或非常长的行可能没有用处。 请注意默认设置通常接近最佳状态,在某些情况下设置此参数可能会产生负面影响。 不能对TOAST表设置此参数。 </para> </listitem> </varlistentry> 31. row 2250 to 2257 ———————————————— 根据WinMerge比较结果,将 may be less, for example due to the setting of <xref linkend="guc-max-worker-processes">. 调整为新内容和新的翻译内容 or by utility statements that use parallel scans may be less, for example due to the setting of <xref linkend="guc-max-worker-processes"/>. </para> ____________________________________________________________________________--> <para> 这个参数设置用于辅助并行扫描这个表的工作者数量。 如果没有设置这个参数,系统将基于关系的尺寸来决定一个值。 规划者或使用并行扫描的实用程序选择的工作者数量可能会比较少,例如<xref linkend="guc-max-worker-processes"/>的设置较小就是一种可能的原因。 32. row 2563 ———————————————— 根据WinMerge比较结果,将 <refsect1 id="SQL-CREATETABLE-notes"> 调整为小写 <refsect1 id="sql-createtable-notes"> 33. row 2638 ———————————————— 根据WinMerge比较结果,将 <refsect1 id="SQL-CREATETABLE-examples"> 调整为小写 <refsect1 id="sql-createtable-examples"> 34. row 2773 ———————————————— 根据WinMerge比较结果,将 name varchar(40) 增加”,“,调整为, name varchar(40), row2785 根据row 2773 调整内容,调整相应翻译内容为 name varchar(40), 35. row 3125 to 3143 ———————————————— 根据WinMerge比较结果,增加相应内容和翻译内容如下 <para> Create a hash partitioned table: <programlisting> CREATE TABLE orders ( order_id bigint not null, cust_id bigint not null, status text ) PARTITION BY HASH (order_id); </programlisting></para> ____________________________________________________________________________--> <para> 建立哈希分区表: <programlisting> CREATE TABLE orders ( order_id bigint not null, cust_id bigint not null, status text ) PARTITION BY HASH (order_id); </programlisting></para> 36. row 3251 to 3291 ———————————————— 根据WinMerge比较结果,增加相应内容和翻译内容如下 <!--==========================orignal english content========================== <para> Create partitions of a hash partitioned table: <programlisting> CREATE TABLE orders_p1 PARTITION OF orders FOR VALUES WITH (MODULUS 4, REMAINDER 0); CREATE TABLE orders_p2 PARTITION OF orders FOR VALUES WITH (MODULUS 4, REMAINDER 1); CREATE TABLE orders_p3 PARTITION OF orders FOR VALUES WITH (MODULUS 4, REMAINDER 2); CREATE TABLE orders_p4 PARTITION OF orders FOR VALUES WITH (MODULUS 4, REMAINDER 3); </programlisting></para> ____________________________________________________________________________--> <para> 建立哈希分区表的分区: <programlisting> CREATE TABLE orders_p1 PARTITION OF orders FOR VALUES WITH (MODULUS 4, REMAINDER 0); CREATE TABLE orders_p2 PARTITION OF orders FOR VALUES WITH (MODULUS 4, REMAINDER 1); CREATE TABLE orders_p3 PARTITION OF orders FOR VALUES WITH (MODULUS 4, REMAINDER 2); CREATE TABLE orders_p4 PARTITION OF orders FOR VALUES WITH (MODULUS 4, REMAINDER 3); </programlisting></para> <!--==========================orignal english content========================== <para> Create a default partition: <programlisting> CREATE TABLE cities_partdef PARTITION OF cities DEFAULT; </programlisting></para> ____________________________________________________________________________--> <para> 建立默认分区: <programlisting> CREATE TABLE cities_partdef PARTITION OF cities DEFAULT; </programlisting></para> 37. row 3294 to 3298 ———————————————— 根据WinMerge比较结果,将 <refsect1 id="SQL-CREATETABLE-compatibility"> <title id="SQL-CREATETABLE-compatibility-title">Compatibility</title> 调整为小写,并调整相应翻译内容。 <refsect1 id="sql-createtable-compatibility"> <!--==========================orignal english content========================== <title id="sql-createtable-compatibility-title">Compatibility</title> ____________________________________________________________________________--> <title id="sql-createtable-compatibility-title">Compatibility</title> 38. row 3470 to 3516 ———————————————— 根据WinMerge比较结果,增加新的内容以及相应翻译内容 </para> </refsect2> <refsect2> <!--==========================orignal english content========================== <title>Constraint Naming</title> ____________________________________________________________________________--> <title>Constraint Naming</title> <!--==========================orignal english content========================== <para> The SQL standard says that table and domain constraints must have names that are unique across the schema containing the table or domain. <productname>PostgreSQL</productname> is laxer: it only requires constraint names to be unique across the constraints attached to a particular table or domain. However, this extra freedom does not exist for index-based constraints (<literal>UNIQUE</literal>, <literal>PRIMARY KEY</literal>, and <literal>EXCLUDE</literal> constraints), because the associated index is named the same as the constraint, and index names must be unique across all relations within the same schema. </para> ____________________________________________________________________________--> <para> SQL标准规定在包含表或域的模式范围内表和域的约束必须具有唯一的名称。 <productname>PostgreSQL</productname>是比较宽松的:它只需要约束名 称在附加到特定表或域的约束之间是唯一的。 但是,对于基于索引的约束(<literal>UNIQUE</literal>,<literal>PRIMARY KEY</literal>, and <literal>EXCLUDE</literal>constraints), 这个特别的自由度并不存在, 因为关联的索引被命名为与约束相同的名称,并且索引名称在相同模式的所有 关系中必须是唯一的。 </para> <!--==========================orignal english content========================== <para> Currently, <productname>PostgreSQL</productname> does not record names for <literal>NOT NULL</literal> constraints at all, so they are not subject to the uniqueness restriction. This might change in a future release. </para> ____________________________________________________________________________--> <para> Currently, <productname>PostgreSQL</productname> does not record names for <literal>NOT NULL</literal> constraints at all, so they are not subject to the uniqueness restriction. This might change in a future release. 当前,<productname>PostgreSQL</productname>没有记录<literal>NOT NULL</literal>约束的名称, 因此它们不受唯一性限制的影响。这在将来的版本中可能会改变。 </para>
1 parent 3a69ab6 commit f68fb38

File tree

1 file changed

+669
-258
lines changed

1 file changed

+669
-258
lines changed

0 commit comments

Comments
 (0)