Re: pg_type oid's do they change from version to version - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_type oid's do they change from version to version
Date
Msg-id 24599.1085021912@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_type oid's do they change from version to version  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
>> I don't think we have ever changed oids for existing data types, so you
>> should be OK.

> Are you sure?  If we remove a type, then its oid becomes up for grabs by 
> the unused_oids script.

But if we remove a type then it's a bit moot whether the OID for it
stays constant.  For types that have remained present across all
versions I don't think we have ever changed the OID assignment.
I'd be willing to promise that this will stay true for the types
that are "manually" declared in pg_type.h.  (As a counterexample,
I think that information_schema.sql creates some domain types, and
those types aren't going to have frozen OIDs.)

> I think the core should mandate it as policy never to reuse oids and 
> perhaps make the unused_oids script "remember" what has been used...

Absolutely not worth the trouble.  If we were to guarantee not to remove
types, then there might be some value in making such a promise, but we
haven't and won't.  (Precedent: the SQL spec itself has added and
dropped datatypes.)
        regards, tom lane


pgsql-hackers by date:

Previous
From: Oliver Jowett
Date:
Subject: Delaying the planning of unnamed statements until Bind
Next
From: "Marc G. Fournier"
Date:
Subject: Re: Call for 7.5 feature completion