Re: Removing pg_migrator limitations - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Removing pg_migrator limitations
Date
Msg-id 12896.1261598986@sss.pgh.pa.us
Whole thread Raw
In response to Re: Removing pg_migrator limitations  (Greg Stark <gsstark@mit.edu>)
Responses Re: Removing pg_migrator limitations  (Greg Stark <gsstark@mit.edu>)
Re: Removing pg_migrator limitations  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> On Wed, Dec 23, 2009 at 7:17 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The reason that isn't implemented is that it's *hard* --- in fact,
>> it appears to be entirely impossible in the general case, unless you're
>> willing to change existing values of the enum on-disk.

> Shouldn't adding new ones be easy?

No, not if you care about where they end up in the type's sort ordering.

In pg_migrator's case that's not an issue because it's going to force
the OID numbering for each of the elements.  However, an ADD ENUM VALUE
option that *doesn't* use a predetermined OID is going to end up
inserting the new value at a not-very-predictable place.  I do not think
we should expose a half-baked behavior like that as standard SQL syntax.
If we're going to implement something whose ambitions only extend to
satisfying pg_migrator's needs, then it should be a specialized
pg_migrator function.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: About the CREATE TABLE LIKE indexes vs constraints issue
Next
From: Robert Haas
Date:
Subject: Re: creating index names automatically?