Re: Can you run out of oids?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Chris Hoover <revoohc(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can you run out of oids?
Date: 2006-08-01 18:36:18
Message-ID: 20060801183617.GA99825@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Aug 01, 2006 at 02:02:18PM -0400, Chris Hoover wrote:
> Somewhat silly question, but is it possible to run out of OID's?

It depends on what you mean by "run out." As the FAQ and documentation
mention, OIDs wrap around and aren't guaranteed to be unique.

http://www.postgresql.org/docs/faqs.FAQ.html#item4.12
http://www.postgresql.org/docs/8.1/interactive/datatype-oid.html
http://www.postgresql.org/docs/8.1/interactive/sql-createtable.html

> Since we upgraded to 8.1.3, I noticed that I can create tables without an
> oid column. I am wondering if I should consider trying to rebuild the
> existing tables to be built without OID.

Avoid using OIDs; if you need a unique identifier use a serial or
bigserial column.

--
Michael Fuhr

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-08-01 18:47:25 Re: prepare, execute & oids
Previous Message Carlo Stonebanks 2006-08-01 18:34:36 Where do Tcl questions go?