Re: How to increase Column width of table

From: Christoph Haller <ch(at)rodos(dot)fzk(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Cc: atul(at)imcindia(dot)net
Subject: Re: How to increase Column width of table
Date: 2003-03-25 15:18:11
Message-ID: 3E807332.9C5EBEE@rodos.fzk.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> Atul here, i have one table and i would like to increase the length
of
> existing column and the sql statement is
>
> Exisiting Column is "vehicle_make" varchar(30)
>
> SQL: alter table commute_profile alter column "vehicle_make"
> varchar(100)
>
> But this gives error.
>
> ERROR: parser: parse error at or near "varchar"
>
I'm afraid there is no one-step-solution to this.
You'll have to go the hard way as

CREATE new_table (
...
... varchar(100),
...
);
INSERT INTO new_table as SELECT * FROM old_table;
DROP old_table;
ALTER TABLE new_table RENAME TO old_table;
And don't forget about re-creating related indexes etc.

Regards, Christoph

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Robert Treat 2003-03-25 16:46:30 Re: How to increase Column width of table
Previous Message Atul Pedgaonkar 2003-03-25 15:10:21 Re: How to increase Column width of table