Re: how to alter an enum type - Mailing list pgsql-general

From Richard Broersma Jr
Subject Re: how to alter an enum type
Date
Msg-id 887842.54507.qm@web31805.mail.mud.yahoo.com
Whole thread Raw
In response to Re: how to alter an enum type  (Henrique Pantarotto <henpa@terra.com.br>)
List pgsql-general
--- On Mon, 12/24/07, Henrique Pantarotto <henpa@terra.com.br> wrote:

> I actually want to change the enum values after I have
> created and
> associated it to a table colum.

It looks like you will have to drop the type and re-create it.

You might have to try a couple of tests:

1) BEGIN TRANSACTION;
DROP the type
create the type
commit; --does your table have still reference this type?

2) BEGIN TRANSACTION;
CREATE a new type with a different name
alter the table column to refer to the new type
drop the old type
Commit;


I wonder if it is possible to create an enum type using a select statement.  This way the contents of the type can be
seenin a base table. and it would be easy to recreate the type when new elements are added or removed.  I'll have to
playaround with this in the future to see what is possible. 

Regards,
Richard Broersma Jr.

pgsql-general by date:

Previous
From: Henrique Pantarotto
Date:
Subject: Re: how to alter an enum type
Next
From: Martijn van Oosterhout
Date:
Subject: Re: how to alter an enum type