X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 135CD40C0D5 for ; Sun, 30 Jan 2005 02:13:25 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 65103-10 for ; Sun, 30 Jan 2005 02:13:02 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [207.106.42.251]) by svr1.postgresql.org (Postfix) with ESMTP id B60D240C029 for ; Sun, 30 Jan 2005 02:08:13 +0000 (GMT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id j0U289X03385; Sat, 29 Jan 2005 21:08:09 -0500 (EST) From: Bruce Momjian Message-Id: <200501300208.j0U289X03385@candle.pha.pa.us> Subject: Re: FAQ 4.15 misleading about uniqueness of OIDs In-Reply-To: <20050124051036.GA39462@winnie.fuhr.org> To: Michael Fuhr Date: Sat, 29 Jan 2005 21:08:09 -0500 (EST) Cc: pgsql-docs@postgresql.org X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200501/66 X-Sequence-Number: 2825 Michael Fuhr wrote: > FAQ 4.15 "What is an OID? What is a TID?" is misleading about the > uniqueness of OIDs. It does mention the possibility of overflow > (while mentioning that nobody has ever reported it), but it doesn't > discourage their use as primary keys like the documentation does > in, for example, the following sections: > > http://www.postgresql.org/docs/8.0/static/datatype-oid.html > http://www.postgresql.org/docs/8.0/static/ddl-system-columns.html Wow, that one really needed updating! Here is the new text: --------------------------------------------------------------------------- 4.15) What is an OID? What is a TID? Every row that is created in PostgreSQL gets a unique OID unless created WITHOUT OIDS. OIDs are autotomatically assigned unique 4-byte integers that are unique across the entire installation. However, they overflow at 4 billion, and then the OIDs start being duplicated. PostgreSQL uses OIDs to link its internal system tables together. To uniquely number columns in user tables, it is best to use SERIAL rather than OIDs because SERIAL sequences are unique only within a single table. and are therefore less likely to overflow. SERIAL8 is available for storing eight-byte sequence values. TIDs are used to identify specific physical rows with block and offset values. TIDs change after rows are modified or reloaded. They are used by index entries to point to physical rows. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073