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

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Matteo Beccati" <php(at)beccati(dot)com>, "Jaime Casanova" <jcasanov(at)systemguards(dot)com(dot)ec>
Cc: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>, "Guillaume Smet" <guillaume(dot)smet(at)gmail(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite
Date: 2009-03-05 19:46:22
Message-ID: 49AFD7AE.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

>>> Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec> wrote:
> ALTER TABLE ... TYPE does cause a table rewrite even if new_type =
> old_type, and that is actually useful...
> for example when you add a fillfactor to an existing table that
> fillfactor will not affect the existing data until you rewrite the
> table and a convenient way is exactly using ALTER TABLE ... TYPE.

I find that to be exactly as useful as it would be to have a table
rewrite if I added a new null-capable column, and somewhat less useful
than it would be have a table rewrite on dropping a column.
Maintaining the function of this clever trick should not be the basis
of imposing a burden on relatively common maintenance operations.

> now, back to the problem... is not easier to define a column as TEXT
> and to put a check to constraint the length? if you wanna change the
> constraint that will be almost free

Thanks for the interesting suggestion. I'm not sure I'd want to go
there for various reasons; but even if I wanted to go that route, how
would I modify that constraint without causing the whole table to be
scanned for compliance?

-Kevin

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jaime Casanova 2009-03-05 19:49:48 Re: Re: [BUGS] BUG #4689: Expanding the length of a VARCHAR column should not induce a table rewrite
Previous Message Jaime Casanova 2009-03-05 19:26:51 Re: [HACKERS] Re: 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 André Volpato 2009-03-05 19:47:58 Re: cbrt() broken in AIX
Previous Message André Volpato 2009-03-05 19:41:49 Re: cbrt() broken in AIX