Re: WIP: extensible enums

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew@dunslane.net>, Dean Rasheed <dean.a.rasheed@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2010-10-23T23:33:32Z
Lists: pgsql-hackers
On Oct 23, 2010, at 7:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> Latest patch attached.
> 
> I've been working through this patch.  It occurs to me that there's a
> fairly serious problem with the current implementation of insertion of
> new values within the bounds of the current sort ordering.  Namely, that
> it does that by reassigning the enumsortorder values of pre-existing
> rows.  That creates a race condition: 

It strikes me that this is merely one facet of our failure to do proper locking on DDL objects other than relations, and that this would be as good a time as any to start fixing it.  ISTM that ALTER TYPE should grab a self-excluding lock just as ALTER TABLE already does.

...Robert