Skip site navigation (1) Skip section navigation (2)

Re: BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: xuan--2009(dot)03--submitbug--support--postgresql(dot)org(at)baldauf(dot)org, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite
Date: 2009-03-04 10:50:15
Message-ID: 49AE5CE7.8010508@gmx.net (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Heikki Linnakangas wrote:
> xuan--2009(dot)03--submitbug--support--postgresql(dot)org(at)baldauf(dot)org wrote:
>> When executing
>> "ALTER TABLE sometable ALTER COLUMN somecolumn TYPE VARCHAR(7)", the 
>> whole
>> table is re-written, and this rewrite takes many hours. During these 
>> hours,
>> all writers on this table stall, making the database effectively
>> unavailable.
>>
>> However, in almost all cases, there is no need for such relaxing of 
>> limits
>> to require a table rewrite.
> 
> While this isn't a bug, it's a reasonable feature request. I've added 
> this to the TODO page: http://wiki.postgresql.org/wiki/Todo#ALTER
> 
> Patches are welcome.

The question is how you want to implement this in a data type 
independent fashion.  You can't assume that increasing the typmod is a 
noop for all data types.

In response to

Responses

pgsql-hackers by date

Next:From: Guillaume SmetDate: 2009-03-04 10:57:17
Subject: Re: BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite
Previous:From: Guillaume SmetDate: 2009-03-04 10:42:06
Subject: Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

pgsql-bugs by date

Next:From: Peter EisentrautDate: 2009-03-04 10:51:05
Subject: Re: BUG #4690: an select query is not using the index
Previous:From: Guillaume SmetDate: 2009-03-04 10:42:06
Subject: Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group