Re: Alter or rename enum value

From: ilmari(at)ilmari(dot)org (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=)
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Alter or rename enum value
Date: 2016-03-25 19:28:24
Message-ID: d8jwpoq5pd3.fsf@dalvik.ping.uio.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:

> On 03/25/2016 04:13 AM, Matthias Kurz wrote:
>>
>> Hopefully at the commitfest at least the transaction limitation
>> will/could be tackled - that would help us a lot already.
>
> I don't believe anyone knows how to do that safely. Enums pose special
> problems here exactly because unlike all other types the set of valid
> values is mutable.

However, this problem (and the one described in the comments of
AlterEnum()) doesn't apply to altering the name, since that doesn't
affect the OID or the ordering. Attached is version 2 of the patch,
which allows ALTER TYPE ... ALTER VALUE inside a transaction.

It still needs documentation, and possibly support for IF (NOT) EXISTS,
if people think that's useful.

Attachment Content-Type Size
0001-Add-ALTER-TYPE-.-ALTER-VALUE-.-TO-v2.patch text/x-diff 12.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2016-03-25 19:30:13 Re: [PATCH] Phrase search ported to 9.6
Previous Message Christophe Pettus 2016-03-25 19:22:59 Re: Alter or rename enum value