Re: Changing Column Type - Mailing list pgsql-sql

From Kevin Brannen
Subject Re: Changing Column Type
Date
Msg-id 3D7E4D5A.3040008@nurseamerica.net
Whole thread Raw
In response to Changing Column Type  (Peter Atkins <peter.atkins@NXCD.com>)
List pgsql-sql
Peter Atkins wrote:
> All,
> 
> Is there a way to easily change the type of  column? Or do I have to drop
> and create again.
> 
> From:
> assignment_notes | character varying(255)
> 
> To:
> assignment_notes | text

Do that kind of change will require creating a new table, copying the 
data, dropping the old table, renaming the new to the old.

If you were changing from varchar(20) to varchar(255), you could hack 
the system tables and be OK (or so I've read).  Going smaller is 
possible too, as long as your 110% sure you don't have any data bigger 
then the new smaller size (or you're taking your life into your own 
hands so to speak. :-)

HTH,
Kevin



pgsql-sql by date:

Previous
From: "Michael Paesold"
Date:
Subject: Re: Rules and Triggers
Next
From: "Ross J. Reedstrom"
Date:
Subject: Re: Rules and Triggers