Re: altering data type in a column - Mailing list pgsql-general

From Len Morgan
Subject Re: altering data type in a column
Date
Msg-id 005601c0e788$9ebc8f60$0908a8c0@H233.bstx.cc
Whole thread Raw
In response to altering data type in a column  ("Madness" <devrim@oper.metu.edu.tr>)
List pgsql-general
The simple answer: No.  What has been suggested here numerous times (check
the archives) is the following procedure:

pg_dump the table you want to change to a text file.
edit the dump file and change the CREATE TABLE section to have an int type
instead of char.
DROP the original table
read in ( \i ) the modified dump table.

You need to make sure that there are NO non-integers in the field you are
changing!

len morgan

-----Original Message-----
From: Madness <devrim@oper.metu.edu.tr>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Date: Monday, May 28, 2001 10:05 AM
Subject: [GENERAL] altering data type in a column


>Hi,
>
>I have a table in one of my databases which has a row of type char. I would
>like to convert it to int data type. Is there an easy way for doing it?
>
>With regards,
>Devrim GÜNDÜZ
>devrim@oper.metu.edu.tr
>
>
>
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: Have you searched our list archives?
>
>http://www.postgresql.org/search.mpl
>


pgsql-general by date:

Previous
From: "Len Morgan"
Date:
Subject: Re: problem with buffer in psql
Next
From: Justin Clift
Date:
Subject: Re: CLISP ?