pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kevin Brannen <kevinb@nurseamerica.net>
To: Peter Atkins <peter.atkins@NXCD.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Changing Column Type
Date: Tue, 10 Sep 2002 14:51:54 -0500
Message-ID: <3D7E4D5A.3040008@nurseamerica.net> (raw)
References: <1CAD483B723BD611B0C10090274FF06855482A@NXCDMAIL>

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




view thread (2+ messages)

Message-ID: <3D7E4D5A.3040008@nurseamerica.net>
Permalink:  ../3D7E4D5A.3040008@nurseamerica.net/
Also on:    postgresql.org/message-id/3D7E4D5A.3040008@nurseamerica.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: kevinb@nurseamerica.net, peter.atkins@NXCD.com
  Subject: Re: Changing Column Type
  In-Reply-To: <3D7E4D5A.3040008@nurseamerica.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox