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

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

From: "" <xuan--2009(dot)03--submitbug--support--postgresql(dot)org(at)baldauf(dot)org>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite
Date: 2009-03-04 01:37:10
Message-ID: 200903040137.n241bAUV035002@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
The following bug has been logged online:

Bug reference:      4689
Logged by:          
Email address:     
xuan--2009(dot)03--submitbug--support--postgresql(dot)org(at)baldauf(dot)org
PostgreSQL version: 8.3.5
Operating system:   Linux 2.6.18-6-amd64
Description:        Expanding the length of a VARCHAR column should not
induce a table rewrite
Details: 

Suppose there is a table "sometable" with a column "somecolumn" of type
"VARCHAR(5)".

This table as many rows.

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.

So the expected run time needed for this statement is about one second, the
actual run time needed for this statement is many hours.

Responses

pgsql-hackers by date

Next:From: Selena DeckelmannDate: 2009-03-04 01:54:54
Subject: Make SIGHUP less painful if pg_hba.conf is not readable
Previous:From: Alvaro HerreraDate: 2009-03-03 23:33:15
Subject: Re: building pg_dump doesn't work

pgsql-bugs by date

Next:From: Heikki LinnakangasDate: 2009-03-04 10:06:59
Subject: Re: BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite
Previous:From: Tom LaneDate: 2009-03-03 15:57:00
Subject: Re: BUG #4688: Bug in cache.

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