Re: changing data type - Mailing list pgsql-novice

From D. Duccini
Subject Re: changing data type
Date
Msg-id Pine.GSO.4.03.10010190033330.843-100000@ra.bpsi.net
Whole thread Raw
In response to changing data type  (Chris <csmith@squiz.net>)
Responses Re: changing data type  (<bmccoy@chapelperilous.net>)
changing datestyle  (Thomas Good <tomg@q8.nrnet.org>)
List pgsql-novice
can't do it (in 6.x)

the best you can do is

alter table rename column1 to oldcolumn1

alter table add column1 attr type;

then insert into it from the old one

alternately, dump the data out, and reload into your new table



On Thu, 19 Oct 2000, Chris wrote:

> Hi all,
>
> I tried to do a search for this, but couldn't find anything.
> How do I change a datatype in postgres?
> eg, change a column from being "text" to "varchar".
>
> Thanks
> ------------------------
> Chris Smith
> http://www.squiz.net
>


-----------------------------------------------------------------------------
david@backpack.com            BackPack Software, Inc.        www.backpack.com
+1 651.645.7550 voice       "Life is an Adventure.
+1 651.645.9798 fax            Don't forget your BackPack!"
-----------------------------------------------------------------------------


pgsql-novice by date:

Previous
From: Chris
Date:
Subject: changing data type
Next
From:
Date:
Subject: Re: changing data type