Re: ENUM drop label workaround

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: Arjen Nienhuis <a(dot)g(dot)nienhuis(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: ENUM drop label workaround
Date: 2013-09-27 18:37:13
Message-ID: CAL_0b1veEL4xsN4Uz76ksBmqUdu6=sf7J0eQ4jXNzQ474jDY=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Sep 27, 2013 at 1:37 AM, Arjen Nienhuis <a(dot)g(dot)nienhuis(at)gmail(dot)com> wrote:
>> Are there any caveats of this solution and may be there is a better one?
>
> Why don't you just create a new ENUM with fewer values? You can use:
> ALTER TABLE ... SET DATA TYPE ... USING col1::text::new_enum_type;
> You might need to recreate some foreign keys.

We will have a lot of big tables with such fields and we couldn't
afford downtime on the ALTERs and other things.

--
Kind regards,
Sergey Konoplev
PostgreSQL Consultant and DBA

http://www.linkedin.com/in/grayhemp
+1 (415) 867-9984, +7 (901) 903-0499, +7 (988) 888-1979
gray(dot)ru(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2013-09-27 18:59:56 Re: Creating Primary Key after CREATE TABLE: Is Sequence created?
Previous Message mdr 2013-09-27 18:27:29 Creating Primary Key after CREATE TABLE: Is Sequence created?