Re: Change column data type

From: Richard Huxton <dev(at)archonet(dot)com>
To: "Senthil Kumar S" <ssakkaravel(at)ivesia(dot)com>, "psql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Change column data type
Date: 2003-09-05 08:15:18
Message-ID: 200309050915.18531.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Huxton 2003-09-05 08:17:11 Re: Fw: Transactions ID
Previous Message Yaroslav Ulyanov 2003-09-05 07:10:00 Fw: Transactions ID