Re: Altering a column type - Most efficient way

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ow Mun Heng wrote:

> If it were this simple a change, I'm not certain why (I believe) PG is
> checking each and every row to see if it will fit into the new column
> definition/type. 

Because the code that does the ALTER TYPE is very generic, and it
doesn't (yet) have an optimization that tells it to skip the check and
the possible table rewrite in the cases where it's obviously not needed
(like this one).

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux