Skip site navigation (1) Skip section navigation (2)

Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing

From: "Tom Dunstan" <pgsql(at)tomd(dot)cc>
To: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: "Andrew Dunstan" <andrew(at)dunslane(dot)net>, "Bruce Momjian" <momjian(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing
Date: 2008-04-25 20:33:24
Message-ID: ca33c0a30804251333x3b4e0aak9d6af7669bc44879@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-committerspgsql-hackers
On Fri, Apr 25, 2008 at 11:57 PM, Alvaro Herrera
<alvherre(at)commandprompt(dot)com> wrote:
>  We already support rewriting tables ... (albeit only one at a time, I
>  admit.  Doing it for more than one can cause deadlocks).
>
>  Still, if the user wants to pay the cost, why should we prohibit it?

One scenario I'm not happy about is this: the friendly db admin has
happily added an extra value to the end before and the operation has
been a snap - no rewriting required. But this time either a) oid
wraparound has occurred, b) she's inserted one or c) she's reordered
them. Bam - we start rewriting the entire database. That's not the
kind of surprise I like giving people, and the current situation of
either don't allow updates at all, or the alternative to surprises of
always rewrite everything seem pretty deficient. And I don't want to
only allow updates if they won't cause a rewrite, it's
nondeterministic.

I've already suggested some alternatives in the reply to Brendan that
would solve some of this, but I suppose another gross-seeming way to
stop surprise rewrites would be to never do one unless given a FORCE
REWRITE clause on the ALTER statement or something like that, and fail
if a rewrite is required not specified.

>  So the user can create a new enum with the options he
>  wants, then rewrite his tables one by one, then drop the original.

They can pretty much do this now, they just need to define an implicit
cast I think.

Cheers

Tom

In response to

Responses

pgsql-hackers by date

Next:From: Brendan JurdDate: 2008-04-25 20:34:14
Subject: Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing
Previous:From: Alvaro HerreraDate: 2008-04-25 20:20:45
Subject: Re: Re: [COMMITTERS] pgsql: Update: < * Allow addingenumerated values to an existing

pgsql-committers by date

Next:From: Brendan JurdDate: 2008-04-25 20:34:14
Subject: Re: Re: [COMMITTERS] pgsql: Update: < * Allow adding enumerated values to an existing
Previous:From: Alvaro HerreraDate: 2008-04-25 20:20:45
Subject: Re: Re: [COMMITTERS] pgsql: Update: < * Allow addingenumerated values to an existing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group