Re: Altering columns without losing data

From: Aarni Ruuhimäki / Megative Tmi / KYMI(dot)com <aarni(dot)ruuhimaki(at)kymi(dot)com>
To: "G" <gerard(at)interfold(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Altering columns without losing data
Date: 2002-05-10 17:55:37
Message-ID: 20020510175710.TSMW29389.fep08.tmt.tele.fi@there
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi !

Not sure if this is the right way, but I've done this succesfully by dumping
(pg_dump -c) the db, then drop the db, edit the dump file's CREATE TABLE
commands to change datatype or length, then restore the db with the dump.

Be careful and make sure you have the dump file somewhere safe.

BR,

aarni

On Thursday 09 May 2002 09:11 pm, you wrote:
> Hello,
>
> Is there a way to change a column's data type without removing and adding
> it (and losing data)? Such as changing the text length for a column.
>
> Thanks,
> Gerard
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Paulo Henrique Werly Gualberto 2002-05-10 19:48:23 pgsql on win98
Previous Message Andrew McMillan 2002-05-10 13:57:10 Re: Time Formatting