deprecating the use of OIDs

From: Neil Conway <neilc(at)samurai(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: deprecating the use of OIDs
Date: 2003-09-29 21:27:59
Message-ID: 1064870879.22498.23.camel@tokyo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I think most people on this list will agree that having OIDs on user
tables is a Bad Thing. For some previous discussion of why, see:

http://www.mail-archive.com/pgsql-hackers(at)postgresql(dot)org/msg27374.html

My understanding of the conclusion of previous discussions on this topic
is that getting rid of OIDs on user tables eventually would be good, but
there is some disagreement / confusion on how exactly to manage the
transition. I think we should do the following for 7.5:

(1) Add a GUC var, with a name such as "default_use_oids", defaulting to
true. This controls whether a CREATE TABLE that doesn't include WITH or
WITHOUT OIDS gets created with OIDs.

(2) When dumping a table, spit out a "SET default_use_oids = xxx" before
the CREATE TABLE. This means that if a table was previously created WITH
OIDS (either explicitly or by default), it will continue to have OIDs
when the dump is restored (regardless of the default value of the GUC
var). We could specify WITH or WITHOUT OIDS as part of the CREATE TABLE
itself, but there were objections earlier about maintaining the
cleanliness of the SQL produced by pg_dump: if the OID-ness of the table
is specified via a separate statement, it is easier for people porting
the SQL to another DBMS to workaround, and a single SET can apply to
multiple CREATE TABLEs.

(2a) We could also add pg_dump options to control this behavior, if
people like.

(3) Add a comment in the release notes saying: (a) the use of OIDs for
user tables is considered a deprecated feature (b) for compatibility
with future versions of PostgreSQL, admins can try setting the GUC var
to false, so they know which (if any) of their apps actually depend upon
the use of OIDS.

(4) In some future release of PostgreSQL (say, 7.6), toggle the GUC var
to false by default.

Objections, comments, etc. are welcome.

-Neil

P.S. It would be nice if we could get this done by 7.4, so as not to
miss a whole release cycle, but that seems out of the question,
unfortunately.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Sullivan 2003-09-29 21:38:04 Re: 2-phase commit
Previous Message Bruce Momjian 2003-09-29 21:26:21 Re: pg_dump permissions problem