Re: Changing Column Type

From: Kevin Brannen <kevinb(at)nurseamerica(dot)net>
To: Peter Atkins <peter(dot)atkins(at)NXCD(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Changing Column Type
Date: 2002-09-10 19:51:54
Message-ID: 3D7E4D5A.3040008@nurseamerica.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Del Mistro, Enzo 2002-09-10 20:16:04 Year and month comparison
Previous Message Michael Paesold 2002-09-10 19:45:16 Re: Rules and Triggers