Re: ALTER TABLE MODIFY COLUMN

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: Mark Butler <butlerm(at)middle(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: ALTER TABLE MODIFY COLUMN
Date: 2001-04-13 05:52:37
Message-ID: 3AD69425.13CA75A4@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Mark Butler wrote:
>
> I was looking at how hard it would be to support altering column types and it
> seems to me that it would be trivial to support changing nullability,

Yes. The problem is how to formulate 'DROP CONSTRAINT' feature.

> increasing the maximum length of the VARCHAR data type and increasing the
> precision or scale of the DECIMAL / NUMERIC data type.
>

Yes. The problem is how PostgreSQL could recognize the fact.

[snip]

> I understand that with the current heap tuple format described in
> backend/access/common.c that changing the type of any fixed length attribute
> requires updating every row.
>
> Surely if we have an write exclusive table lock we can rewrite tuples in place
> rather than creating new versions with its corresponding 2x space requirement.
>

PostgreSQL has a no overwrite storage manager, so this
seems to have little advantage. We now have a mechanism
to replace existent relation files safely. We could
avoid running VACUUM, multiple version of tuples in
a file etc ...

regards,
Hiroshi Inoue

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-04-13 06:35:07 Re: Yacc / Bison difficulties
Previous Message Mark Butler 2001-04-13 05:21:16 Re: DOUBLE synonym for DOUBLE PRECISION