Re: Alter or rename enum value

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: <emre(at)hasegeli(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Christophe Pettus <xof(at)thebuild(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Matthias Kurz <m(dot)kurz(at)irregular(dot)at>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Alter or rename enum value
Date: 2016-03-29 06:57:17
Message-ID: 56FA274D.4020108@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/28/16 4:42 AM, Emre Hasegeli wrote:
> Now, we are using a
> function to replace an enum type on all tables with another one, but
> we are not at all happy with this solution. It requires all objects
> which were using the enum to be dropped and recreated, and it rewrites
> the tables, so it greatly increases the migration time and effort.

FWIW, there are ways to avoid some of that pain by having a trigger
maintain the new column on INSERT/UPDATE and then slowly touching all
the old rows where the new column is NULL.

Obviously would be much better if we could just do this with ENUMs...
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Moench-Tegeder 2016-03-29 07:01:34 Re: pthread portability
Previous Message Jim Nasby 2016-03-29 06:46:34 Re: backup tools ought to ensure created backups are durable