@@ -586,18 +586,65 @@ ____________________________________________________________________________-->
586
586
要为一个新的预装载行找到一个可用的OID,可以运行脚本<filename>src/include/catalog/unused_oids</filename>。它能打印出未被使用的OID的闭区间范围(例如,输出行<quote>45-900</quote>表示OID 45到900都还没有被分配出去)。当前,OID 1-9999被保留给手工分配,<filename>unused_oids</filename>脚本会简单地查看目录头部以及<filename>.dat</filename>文件来看看哪些OID没有出现。也可以使用<filename>duplicate_oids</filename>脚本来检查错误(<filename>genbki.pl</filename>将为没有手工分配给他们的任何行分配OID,还会在编译时检测重复的OID)。
587
587
</para>
588
588
589
+ <!--==========================orignal english content==========================
590
+ <para>
591
+ When choosing OIDs for a patch that is not expected to be committed
592
+ immediately, best practice is to use a group of more-or-less
593
+ consecutive OIDs starting with some random choice in the range
594
+ 8000—9999. This minimizes the risk of OID collisions with other
595
+ patches being developed concurrently. To keep the 8000—9999
596
+ range free for development purposes, after a patch has been committed
597
+ to the master git repository its OIDs should be renumbered into
598
+ available space below that range. Typically, this will be done
599
+ near the end of each development cycle, moving all OIDs consumed by
600
+ patches committed in that cycle at the same time. The script
601
+ <filename>renumber_oids.pl</filename> can be used for this purpose.
602
+ If an uncommitted patch is found to have OID conflicts with some
603
+ recently-committed patch, <filename>renumber_oids.pl</filename> may
604
+ also be useful for recovering from that situation.
605
+ </para>
606
+ ____________________________________________________________________________-->
589
607
<para>
590
608
在为一个不会立即提交的补丁选择OID时,最佳实践是使用一组接近连续的OID,以8000—9999范围中随机选择的值作为开始。这样就将其与其他同时开发的补丁的冲突的风险降至最低。为了保持8000—9999范围对于开发来讲可自由使用,在补丁提交到git库之后,应使用低于该范围的可用空间重新编号。通常这项工作会在接近每次开发周期的尾声时做,与此同时移动由该周期提交的补丁所消费掉的所有OID。<filename>renumber_oids.pl</filename>脚本可用来完成该项工作。如果发现一个未提交的补丁与一些近来提交的补丁有OID冲突,<filename>renumber_oids.pl</filename>也可用于从此状况下的恢复。
591
609
</para>
592
610
611
+ <!--==========================orignal english content==========================
612
+ <para>
613
+ Because of this convention of possibly renumbering OIDs assigned by
614
+ patches, the OIDs assigned by a patch should not be considered stable
615
+ until the patch has been included in an official release. We do not
616
+ change manually-assigned object OIDs once released, however, as that
617
+ would create assorted compatibility problems.
618
+ </para>
619
+ ____________________________________________________________________________-->
593
620
<para>
594
621
因为此约定可能会对补丁程序分配的OID重新编号,在补丁纳入到官方发布版本之前,补丁所分配的OID不应该认为是稳定的。一旦发布,我们并不修改手工分配的对象OID,但是那样会产生各种各样的兼容性问题。
595
622
</para>
596
623
624
+ <!--==========================orignal english content==========================
625
+ <para>
626
+ If <filename>genbki.pl</filename> needs to assign an OID to a catalog
627
+ entry that does not have a manually-assigned OID, it will use a value in
628
+ the range 10000—11999. The server's OID counter is set to 12000
629
+ at the start of a bootstrap run. Thus objects created by regular SQL
630
+ commands during the later phases of bootstrap, such as objects created
631
+ while running the <filename>information_schema.sql</filename> script,
632
+ receive OIDs of 12000 or above.
633
+ </para>
634
+ ____________________________________________________________________________-->
597
635
<para>
598
636
如果需要为没有手工分配的OID的目录条目分配OID,<filename>genbki.pl</filename>将使用10000—11999范围内的值。在自举运行的开始,服务器的OID计数器设置为12000 。这样自举的后期由SQL命令创建的对象,例如运行<filename>information_schema.sql</filename>脚本时创建的对象,接收的OID为12000或更高。
599
637
</para>
600
638
639
+ <!--==========================orignal english content==========================
640
+ <para>
641
+ OIDs assigned during normal database operation are constrained to be
642
+ 16384 or higher. This ensures that the range 10000—16383 is free
643
+ for OIDs assigned automatically by <filename>genbki.pl</filename> or
644
+ during bootstrap. These automatically-assigned OIDs are not considered
645
+ stable, and may change from one installation to another.
646
+ </para>
647
+ ____________________________________________________________________________-->
601
648
<para>
602
649
在正常数据库操作期间分配的OID限制为16384或更高。这样确保对于<filename>genbki.pl</filename>自动分配或自举过程中的OID可以使用范围10000—16383内的值 。这些自动分配的OID不稳定,从一种安装到另一安装可能会改变。
603
650
</para>
@@ -1153,7 +1200,6 @@ ____________________________________________________________________________-->
1153
1200
<replaceable class="parameter">tableoid</replaceable>
1154
1201
<optional><literal>bootstrap</literal></optional>
1155
1202
<optional><literal>shared_relation</literal></optional>
1156
- <optional><literal>without_oids</literal></optional>
1157
1203
<optional><literal>rowtype_oid</literal> <replaceable>oid</replaceable></optional>
1158
1204
(<replaceable class="parameter">name1</replaceable> =
1159
1205
<replaceable class="parameter">type1</replaceable>
0 commit comments