Search Postgresql Archives

Re: how to alter an enum type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- On Mon, 12/24/07, Henrique Pantarotto <henpa@xxxxxxxxxxxx> 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 seen in a base table. and it would be easy to recreate the type when new elements are added or removed.  I'll have to play around with this in the future to see what is possible.

Regards,
Richard Broersma Jr.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux