diff options
Diffstat (limited to 'doc/src/sgml/syntax.sgml')
-rw-r--r-- | doc/src/sgml/syntax.sgml | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/doc/src/sgml/syntax.sgml b/doc/src/sgml/syntax.sgml index 300851235ca..fd340b0c940 100644 --- a/doc/src/sgml/syntax.sgml +++ b/doc/src/sgml/syntax.sgml @@ -1,5 +1,5 @@ <!-- -$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.43 2001/06/19 22:39:08 tgl Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/syntax.sgml,v 1.44 2001/08/10 18:57:32 tgl Exp $ --> <chapter id="sql-syntax"> @@ -641,8 +641,9 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) <primary>OID</primary> </indexterm> The unique identifier (object ID) of a row. This is a serial number - that is added by Postgres to all rows automatically. OIDs are not - reused and are 32-bit quantities. + that is automatically added by Postgres to all table rows (unless + the table was created WITHOUT OIDS, in which case this column is + not present). </para> </listitem> </varlistentry> @@ -686,8 +687,10 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) <listitem> <para> The identity (transaction ID) of the deleting transaction, - or zero for an undeleted tuple. In practice, this is never nonzero - for a visible tuple. + or zero for an undeleted tuple. It is possible for this field + to be nonzero in a visible tuple: that indicates that the + deleting transaction hasn't committed yet, or that an attempted + deletion was rolled back. </para> </listitem> </varlistentry> @@ -697,7 +700,6 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) <listitem> <para> The command identifier within the deleting transaction, or zero. - Again, this is never nonzero for a visible tuple. </para> </listitem> </varlistentry> @@ -721,9 +723,26 @@ CAST ( '<replaceable>string</replaceable>' AS <replaceable>type</replaceable> ) </para> <para> + OIDs are 32-bit quantities and are assigned from a single cluster-wide + counter. In a large or long-lived database, it is possible for the + counter to wrap around. Hence, it is bad practice to assume that OIDs + are unique, unless you take steps to ensure that they are unique. + Recommended practice when using OIDs for row identification is to create + a unique index on the OID column of each table for which the OID will be + used. Never assume that OIDs are unique across tables; use the + combination of tableoid and row OID if you need a database-wide + identifier. (Future releases of Postgres are likely to use a separate + OID counter for each table, so that tableoid <emphasis>must</> be + included to arrive at a globally unique identifier.) + </para> + + <para> + Transaction and command identifiers are 32-bit quantities. + </para> + + <para> For further information on the system attributes consult <xref linkend="STON87a" endterm="STON87a">. - Transaction and command identifiers are 32-bit quantities. </para> </sect1> |