Re: How to modify ENUM datatypes? (The solution) - Mailing list pgsql-general

From Dmitry Koterov
Subject Re: How to modify ENUM datatypes? (The solution)
Date
Msg-id d7df81620808130220j7302f7adqc6fde4ab171952b4@mail.gmail.com
Whole thread Raw
In response to Re: How to modify ENUM datatypes? (The solution)  ("Merlin Moncure" <mmoncure@gmail.com>)
Responses Re: How to modify ENUM datatypes? (The solution)
List pgsql-general
About LGPL - I don't know.
But the license is not a problem, this code is totally freeware (because too simple).
LGPL is just my favorite license type for years. :-)

I'll change this if you prefer another license and explain, why (why BSD? BSD is the PostgreSQL license?)


On Wed, Aug 13, 2008 at 4:25 AM, Merlin Moncure <mmoncure@gmail.com> wrote:
On Tue, Aug 12, 2008 at 5:40 PM, Dmitry Koterov <dmitry@koterov.ru> wrote:
> Here is the solution about "on the fly" ALTER ENUM:
> http://en.dklab.ru/lib/dklab_postgresql_enum/
>
> Usage:
>
> -- Add a new element to the ENUM "on the fly".
>
> SELECT enum.enum_add('my_enum', 'third');
>
> -- Remove an element from the ENUM "on the fly".
> SELECT enum.enum_del('my_enum', 'first');
>
> Possibly future versions of PostgreSQL will include built-in ALTER TYPE for
> ENUM, all the more its implementation is not impossible, as you see above.
> Hope this will be helpful.

Decent user space solution...it's easy enough.  IMO 'real' solution is
through alter type as you suggest.  It's worth noting there there is
no handling for the unlikely but still possible event of oid
wraparound.  Also, there is no 'enum_insert', which is not so pleasant
with how enums are implemented.

Also, is lgpl compatible with bsd licnese? Not that it matters, but I'm curious.

merlin

pgsql-general by date:

Previous
From: "Dave Page"
Date:
Subject: Re: mac install question
Next
From: "Dmitry Koterov"
Date:
Subject: Re: How to get many data at once?