Re: [1.4rc1] Can't change column type - Mailing list pgadmin-support

From Joost Kraaijeveld
Subject Re: [1.4rc1] Can't change column type
Date
Msg-id 1131265234.6003.24.camel@Panoramix
Whole thread Raw
In response to [1.4rc1] Can't change column type  (Chris <chris.velevitch@gmail.com>)
List 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.Kraaijeveld@Askesis.nl
web: www.askesis.nl 




pgadmin-support by date:

Previous
From: Chris
Date:
Subject: [1.4rc1] Can't rename constraint
Next
From: Chris
Date:
Subject: Re: [1.4rc1] Can't change column type