pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: Senthil Kumar S <ssakkaravel@ivesia.com>
To: psql <pgsql-sql@postgresql.org>
Subject: Re: Change column data type
Date: Fri, 5 Sep 2003 09:15:18 +0100
Message-ID: <200309050915.18531.dev@archonet.com> (raw)
In-Reply-To: <000c01c37137$a6e87ce0$7502a8c0@hdsc.com>
References: <000c01c37137$a6e87ce0$7502a8c0@hdsc.com>

On Tuesday 02 September 2003 10:50, Senthil Kumar S wrote:
> Dear Friends,
>
> Using Postgres 7.3.4 over the linux server 7.3.
>
> Is it possible to alter/change the data type of a existing table's column,
> with out dropping and recreating a column of same name.
>
> Thanks for ur knowledge sharing.

If you mean changing a varchar to a date or int4 to text, then no. If you want 
to change the size of a varchar field, people seem to have done that in the 
past (check the archives for details).

Otherwise, you'll have to wrap the drop/recreate in a transaction along with 
whatever supporting updates you need.
-- 
  Richard Huxton
  Archonet Ltd



view thread (4+ messages)

Message-ID: <200309050915.18531.dev@archonet.com>
Permalink:  ../200309050915.18531.dev@archonet.com/
Also on:    postgresql.org/message-id/200309050915.18531.dev@archonet.com

 · 

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: dev@archonet.com, ssakkaravel@ivesia.com
  Subject: Re: Change column data type
  In-Reply-To: <200309050915.18531.dev@archonet.com>

* 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