Re: OID wraparound: summary and proposal

From: mlw <markw(at)mohawksoft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: OID wraparound: summary and proposal
Date: 2001-08-03 12:47:37
Message-ID: 3B6A9D69.48C09C57@mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>
[Snipped]

I think making "WITHOUT OIDS" the default for table creation is the right thing
to do. Here is my reasoning:

An OID is a system wide limitation. 4B or 2B depending on sign-ness. (could
there be some bugs still lurking on high OIDs?) Since the OID is a shared
system wide limited resource, it should be limited to "system" tables which
require it.

To new comers to PostgreSQL this limitation will not be obvious until they hit
it. Then they will kick themselves for not reading more carefully.

An OID does not add any real value to the database developer. Given an OID, one
can not determine anything about the record it represents. One also needs the
table and database from which it came, and even then one has to create an index
on the OID column on the table to get to the record efficiently. It can only
indicate the order in which records were entered.

If people need something like OID for their tables, the documented "preferred
way" could be:
create sequence fubar;
create table fubar
(
rowid integer default nextval('fubar_seq'),
...
);

Then explain that they can use "WITH OID" but there is a system wide limit.

On a side note: I know it is probably a lot of work, and it has been shot down
once, but the notion of a rowid built into a table would be useful. It would
solve wrap around and keep the useful functionality of OID, and be more
efficient and robust than using the sequence.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Tiffin 2001-08-03 13:17:10 Re: Proposal: OID wraparound: summary and proposal
Previous Message mlw 2001-08-03 12:12:45 Re: OID wraparound: summary and proposal