Re: altering the datatype of a column. - Mailing list pgsql-general

From Oliver Elphick
Subject Re: altering the datatype of a column.
Date
Msg-id 1091642544.31602.3090.camel@linda
Whole thread Raw
In response to altering the datatype of a column.  (Prabu Subroto <prabu_subroto@yahoo.com>)
List pgsql-general
On Wed, 2004-08-04 at 18:47, Prabu Subroto wrote:
> Dear my friends...
>
> I want to change the datatype of a completed table
> (has had already content).
> But I don't know how.
...
> Please tell me how.

It is not possible in 7.4

Create a new column of the correct type; update the table to set the new
column to have the data from the old one; delete the old column; rename
the new one.

--
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
                 ========================================
     "And not only so, but we glory in tribulations also;
      knowing that tribulation worketh patience; And
      patience, experience; and experience, hope."
                                        Romans 5:3,4


pgsql-general by date:

Previous
From: David Rysdam
Date:
Subject: Re: COPY not handling BLOBs
Next
From: "Jim C. Nasby"
Date:
Subject: Re: Casting timestamp with time zone to varchar automatically