Re: [PATCH] Space reservation v02 - Mailing list pgsql-hackers

From Robert Haas
Subject Re: [PATCH] Space reservation v02
Date
Msg-id 603c8f070901310855l31c9dc8dta69f5d16ea09826f@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Space reservation v02  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: [PATCH] Space reservation v02  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Re: [PATCH] Space reservation v02  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
> Ofcourse, the simplest way to me for handling type changes seems to be
> to keep the old type OID reserved and have the new version of the type
> with a new OID. Then the entire problem vanishes. But it was decided a
> long time ago not to do that.

Why was that decision made?  Suppose you have a type called widget and
you decide it sucks and you want to reimplement it.  So in release
N+1, you rename the old type to old_shitty_widget and leave it with
the same OID, add the new type under the name widget with a different
oid, and document that old_shitty_widget should not be used.  Then in
release N+2 you remove old_shitty_widget altogether.

People who upgrade via pg_dump will automatically get the new and
improved widget type because that is what is now called widget.  But
people who in-place upgrade will end up with the old_shitty_widget
type.  Then you just run some dead simple postupdate script that goes
through and issues ALTER TABLE commands to change each
old_shitty_widget column to a widget column.

...Robert


pgsql-hackers by date:

Previous
From: Grzegorz Jaskiewicz
Date:
Subject: adding stuff to parser, question
Next
From: Grzegorz Jaskiewicz
Date:
Subject: Re: adding stuff to parser, question