Re: ALTER TABLE modifications - Mailing list pgsql-patches

From Peter Eisentraut
Subject Re: ALTER TABLE modifications
Date
Msg-id Pine.LNX.4.44.0311131514220.16787-100000@peter.localdomain
Whole thread Raw
In response to Re: ALTER TABLE modifications  (Rod Taylor <pg@rbt.ca>)
Responses Re: ALTER TABLE modifications
List pgsql-patches
Rod Taylor writes:

> Yes, it is certainly fine to do so, but much faster to do the above.

Are table schema changes performance-sensitive operations, and are they
usually done in bulk?  I doubt it.

> I've not found another database which allows this syntax. The suggestion
> of TRANSFORM was Toms and was a result of using an assignment cast by
> default. Do you have a better term I can use?

I'm not sure I buy this whole concept in the first place.  If there is
no cast between type A and type B, then surely changing a table column
from A to B is nonsensical.

> -- or say Bytes to MBytes  (original column is int8)
> ALTER TABLE tab ALTER col TYPE integer TRANSFORM col / (1024 * 1024);

You can do this using a plain column type change plus an UPDATE.  I'd
prefer to keep these operations independent.

--
Peter Eisentraut   peter_e@gmx.net


pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: ALTER TABLE modifications
Next
From: Bruce Momjian
Date:
Subject: Re: [pgsql-hackers-win32] initdb in C