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

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: xuan--2009(dot)03--submitbug--support--postgresql(dot)org(at)baldauf(dot)org
Cc: 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:06:59
Message-ID: 49AE52C3.2070909@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

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.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message vikas 2009-03-04 10:15:49 BUG #4690: an select query is not using the index
Previous Message xuan--2009.03--submitbug--support--postgresql.org 2009-03-04 01:37:10 BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite

Browse pgsql-hackers by date

  From Date Subject
Next Message Guillaume Smet 2009-03-04 10:42:06 Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite
Previous Message Magnus Hagander 2009-03-04 09:28:42 Re: Make SIGHUP less painful if pg_hba.conf is not readable