Re: alter enum add value if not exists

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: alter enum add value if not exists
Date: 2012-09-22 17:06:08
Message-ID: 505DF000.10006@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 09/20/2012 06:34 PM, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> On 08/23/2012 07:39 AM, Magnus Hagander wrote:
>>> It doesn't break, of course ,since it's protected by the unique index.
>>> But aren't you at risk of getting the very error message you're trying
>>> to avoid?
>> Yeah, looking further this was probably a thinko on my part. Thanks for
>> noticing. I've moved the test down so it's done right after the lock is
>> acquired. Revised patch attached.
> This patch looks sane as far as it goes. It strikes me though that if
> we're going to invent an opt_if_not_exists production in the grammar,
> there are a lot of other places where it should be used too, for
> consistency if nothing else.
>
> However, it would be reasonable to do that mop-up as a separate
> commit. If you prefer, commit what you've got and then I'll see
> about the other thing.
>
>

The enum piece is now committed.

I agree cleaning this up would be a good idea.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message md@rpzdesign.com 2012-09-22 17:37:09 Re: [RFC][PATCH] wal decoding, attempt #2 - Design Documents (really attached)
Previous Message Andres Freund 2012-09-22 17:00:53 Re: [RFC][PATCH] wal decoding, attempt #2 - Design Documents (really attached)