From: Robert Treat <xzilla@users.sourceforge.net>
To: Christoph Haller <ch@rodos.fzk.de>
Cc: pgsql-sql@postgresql.org
Cc: atul@imcindia.net
Subject: Re: How to increase Column width of table
Date: 25 Mar 2003 11:46:30 -0500
Message-ID: <1048610790.13799.491.camel@camel> (raw)
In-Reply-To: <3E807332.9C5EBEE@rodos.fzk.de>
References: <3E807332.9C5EBEE@rodos.fzk.de>
http://fts.postgresql.org/db/mw/msg.html?mid=1071582
On Tue, 2003-03-25 at 10:18, Christoph Haller wrote:
> >
> > 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: xzilla@users.sourceforge.net, ch@rodos.fzk.de, atul@imcindia.net
Subject: Re: How to increase Column width of table
In-Reply-To: <1048610790.13799.491.camel@camel>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox