Re: [1.4rc1] Can't change column type

From: Joost Kraaijeveld <J(dot)Kraaijeveld(at)Askesis(dot)nl>
To: Chris <chris(dot)velevitch(at)gmail(dot)com>
Cc: PgAdmin-support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: [1.4rc1] Can't change column type
Date: 2005-11-06 08:20:34
Message-ID: 1131265234.6003.24.camel@Panoramix
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Sun, 2005-11-06 at 01:12 +0000, Chris wrote:
> I'm trying to change a char(30) to varchar(64), but I can't find a way to do it.
> I select the table, select properties, select the column and click change, but
> the data type and lengths are grayed out.
>
> How do I change this column from char(30) to varchar(64)?

Does this work (replace the names according to your schema)?

BEGIN;
ALTER TABLE table_name ADD COLUMN new_column varchar(64)?;
UPDATE table_name SET new_column = column;
ALTER TABLE customer RENAME column TO old_column;
ALTER TABLE customer RENAME new_column TO columns;
COMMIT;

--
Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J(dot)Kraaijeveld(at)Askesis(dot)nl
web: www.askesis.nl

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Chris 2005-11-06 08:36:38 Re: [1.4rc1] Can't change column type
Previous Message Joost Kraaijeveld 2005-11-06 07:10:16 Beta3: Explain gives error where PgAdmin 1.2.2 does not