change column data type from smallint to integer

From: "pobox(at)verysmall(dot)org" <pobox(at)verysmall(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: change column data type from smallint to integer
Date: 2005-09-08 02:22:07
Message-ID: 431FA04F.1000607@verysmall.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

we run 'out of space' in one of our columns which is smallint and we
need to make it integer.

I did some research and found out that the only way is to create a new
column with integer data type, then SET new = old, then drop old and
rename new like old [1].

Could somebody confirm if this is really the best way and if it is
stable in respect to indexes, RI, triggers, stored procedures, etc.

Thank you,
Iv

[1]
http://www.foranewliberty.com/blog/archives/2005/01/15/changing-data-types-in-postgresql/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Leonid Safronie 2005-09-08 02:45:33 Cost based SELECT/UPDATE
Previous Message Matthew Peter 2005-09-08 00:26:07 Re: back references using regex