X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0F68B475EA4 for ; Tue, 25 Mar 2003 10:18:12 -0500 (EST) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id BD1CD475C98 for ; Tue, 25 Mar 2003 10:18:10 -0500 (EST) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Tue Mar 25 16:18:12 2003 +0100 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id QAA18929; Tue, 25 Mar 2003 16:18:11 +0100 (MET) Message-ID: <3E807332.9C5EBEE@rodos.fzk.de> Date: Tue, 25 Mar 2003 16:18:11 +0100 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Cc: atul@imcindia.net Subject: Re: How to increase Column width of table Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-9.6 required=5.0 tests=BAYES_10,QUOTED_EMAIL_TEXT,QUOTE_TWICE_1 autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/555 X-Sequence-Number: 12593 > > 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