Re: [PATCH] Alter or rename enum value

Marko Tiikkaja <marko@joh.to>

From: Marko Tiikkaja <marko@joh.to>
To: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, pgsql-hackers@postgresql.org
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Andrew Dunstan <andrew@dunslane.net>, Matthias Kurz <m.kurz@irregular.at>, Jim Nasby <Jim.Nasby@BlueTreble.com>, "David G. Johnston" <david.g.johnston@gmail.com>
Date: 2016-03-27T17:43:27Z
Lists: pgsql-hackers
On 2016-03-27 19:30, Dagfinn Ilmari Mannsåker wrote:
> ilmari@ilmari.org (Dagfinn Ilmari Mannsåker) writes:
>
>> I was bored and thought "how hard could it be?", and a few hours'
>> hacking later, I have something that seems to work.  It doesn't do IF
>> NOT EXISTS yet, and the error messaging could do with some improvement,
>> and there are no docs.  The patch is attached, as well as at
>> https://github.com/ilmari/postgres/commit/enum-alter-value
>
> Here's v3 of the patch of the patch, which I consider ready for proper
> review.

A couple of trivial comments below.

   +    <term><literal>ALTER VALUE [ IF EXISTST ] TO [ IF NOT EXISTS 
]</literal></term>

typo EXISTST

   +      If <literal>IF EXISTS</literal> or is <literal>IF NOT 
EXISTS</literal>
   +      is specified, it is not an error if the type doesn't contain 
the old

double is

   +      if the old value is not alreeady present or the new value is.

typo alreeady

   + * RenameEnumLabel
   + *		Add a new label to the enum set. By default it goes at

copypaste-o?

   +	if (!stmt->oldVal) {

not project curly brace style


.m


Commits

  1. Relax transactional restrictions on ALTER TYPE ... ADD VALUE (redux).

  2. Partially restore comments discussing enum renumbering hazards.

  3. Allow adding values to an enum type created in the current transaction.