Re: Converting char to varchar automatically

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <hari(dot)fuchs(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Converting char to varchar automatically
Date: 2014-10-08 00:33:22
Message-ID: 54348652.6090903@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/6/14, 6:16 PM, Tom Lane wrote:
> Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com> writes:
>> Just a heads-up: each of those ALTER's will rewrite the table, so unless your database is tiny this will be a slow process. There's ways to work around that, but they're significantly more complicated.
>
> I think he's trying to get rid of all the blank-padding he's got right
> now, so table rewrites are unavoidable.

Right, but there's other ways this could be done without requiring an outage. Like creating the new column with temporary name, put trigger on table, etc, etc.

Having dealt with an environment where downtime was thousands of dollars per minute I've gotten very creative at not taking outages. :)
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gavin Flower 2014-10-08 03:40:59 Re: table versioning approach (not auditing)
Previous Message Jim Nasby 2014-10-08 00:29:22 Re: table versioning approach (not auditing)