Skip to content

Commit e358a61

Browse files
committed
Updates for schema features.
1 parent 52200be commit e358a61

File tree

4 files changed

+352
-80
lines changed

4 files changed

+352
-80
lines changed

doc/src/sgml/datatype.sgml

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.90 2002/04/25 02:56:55 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/datatype.sgml,v 1.91 2002/04/25 20:14:43 tgl Exp $
33
-->
44

55
<chapter id="datatype">
@@ -2924,6 +2924,18 @@ SELECT SUBSTRING(b FROM 1 FOR 2) FROM test;
29242924
<primary>regtype</primary>
29252925
</indexterm>
29262926

2927+
<indexterm zone="datatype-oid">
2928+
<primary>xid</primary>
2929+
</indexterm>
2930+
2931+
<indexterm zone="datatype-oid">
2932+
<primary>cid</primary>
2933+
</indexterm>
2934+
2935+
<indexterm zone="datatype-oid">
2936+
<primary>tid</primary>
2937+
</indexterm>
2938+
29272939
<para>
29282940
Object identifiers (OIDs) are used internally by
29292941
<productname>PostgreSQL</productname> as primary keys for various system
@@ -3034,7 +3046,7 @@ SELECT SUBSTRING(b FROM 1 FOR 2) FROM test;
30343046
</para>
30353047

30363048
<para>
3037-
All of the alias types accept schema-qualified names, and will
3049+
All of the OID alias types accept schema-qualified names, and will
30383050
display schema-qualified names on output if the object would not
30393051
be found in the current search path without being qualified.
30403052
The <type>regproc</> and <type>regoper</> alias types will only
@@ -3045,6 +3057,52 @@ SELECT SUBSTRING(b FROM 1 FOR 2) FROM test;
30453057
operand.
30463058
</para>
30473059

3060+
<para>
3061+
OIDs are 32-bit quantities and are assigned from a single cluster-wide
3062+
counter. In a large or long-lived database, it is possible for the
3063+
counter to wrap around. Hence, it is bad practice to assume that OIDs
3064+
are unique, unless you take steps to ensure that they are unique.
3065+
Recommended practice when using OIDs for row identification is to create
3066+
a unique constraint on the OID column of each table for which the OID will
3067+
be used. Never assume that OIDs are unique across tables; use the
3068+
combination of <structfield>tableoid</> and row OID if you need a
3069+
database-wide identifier. (Future releases of
3070+
<productname>PostgreSQL</productname> are likely to use a separate
3071+
OID counter for each table, so that <structfield>tableoid</>
3072+
<emphasis>must</> be included to arrive at a globally unique identifier.)
3073+
</para>
3074+
3075+
<para>
3076+
Another identifier type used by the system is <type>xid</>, or transaction
3077+
(abbreviated xact) identifier. This is the datatype of the system columns
3078+
<structfield>xmin</> and <structfield>xmax</>.
3079+
Transaction identifiers are 32-bit quantities. In a long-lived
3080+
database it is possible for transaction IDs to wrap around. This
3081+
is not a fatal problem given appropriate maintenance procedures;
3082+
see the <citetitle>Administrator's Guide</> for details. However, it is
3083+
unwise to depend on uniqueness of transaction IDs over the long term
3084+
(more than one billion transactions).
3085+
</para>
3086+
3087+
<para>
3088+
A third identifier type used by the system is <type>cid</>, or command
3089+
identifier. This is the datatype of the system columns
3090+
<structfield>cmin</> and <structfield>cmax</>.
3091+
Command identifiers are also 32-bit quantities. This creates a hard
3092+
limit of 2<superscript>32</> (4 billion) SQL commands within a single
3093+
transaction.
3094+
In practice this limit is not a problem --- note that the limit is on
3095+
number of SQL queries, not number of tuples processed.
3096+
</para>
3097+
3098+
<para>
3099+
A final identifier type used by the system is <type>tid</>, or tuple
3100+
identifier. This is the datatype of the system column
3101+
<structfield>ctid</>. A tuple ID is a pair
3102+
(block number, tuple index within block) that identifies the
3103+
physical location of the tuple within its table.
3104+
</para>
3105+
30483106
</sect1>
30493107

30503108
</chapter>

doc/src/sgml/queries.sgml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/queries.sgml,v 1.14 2001/11/28 20:49:10 petere Exp $ -->
1+
<!-- $Header: /cvsroot/pgsql/doc/src/sgml/queries.sgml,v 1.15 2002/04/25 20:14:43 tgl Exp $ -->
22

33
<chapter id="queries">
44
<title>Queries</title>
@@ -86,7 +86,8 @@ SELECT random();
8686
FROM <replaceable>table_reference</replaceable> <optional>, <replaceable>table_reference</replaceable> <optional>, ...</optional></optional>
8787
</synopsis>
8888

89-
A table reference may be a table name or a derived table such as a
89+
A table reference may be a table name (possibly schema-qualified),
90+
or a derived table such as a
9091
subquery, a table join, or complex combinations of these. If more
9192
than one table reference is listed in the FROM clause they are
9293
cross-joined (see below) to form the derived table that may then

0 commit comments

Comments
 (0)