Re: Alter or rename enum value - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: Alter or rename enum value
Date
Msg-id 56FA274D.4020108@BlueTreble.com
Whole thread Raw
In response to Re: Alter or rename enum value  (Emre Hasegeli <emre@hasegeli.com>)
List 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



pgsql-hackers by date:

Previous
From: Jim Nasby
Date:
Subject: Re: backup tools ought to ensure created backups are durable
Next
From: Christoph Moench-Tegeder
Date:
Subject: Re: pthread portability