X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 0FD98D1B89D for ; Fri, 5 Sep 2003 08:15:53 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 10967-03 for ; Fri, 5 Sep 2003 05:15:22 -0300 (ADT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by svr1.postgresql.org (Postfix) with ESMTP id F0F36D1B89F for ; Fri, 5 Sep 2003 05:15:19 -0300 (ADT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-35.mail.demon.net with esmtp (Exim 3.35 #1) id 19vBkW-0007u5-0Z; Fri, 05 Sep 2003 09:15:21 +0100 Received: from localhost (localhost.localdomain [127.0.0.1]) by mainbox.archonet.com (Postfix) with ESMTP id E42011686E; Fri, 5 Sep 2003 09:15:19 +0100 (BST) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 7AFB71686B; Fri, 5 Sep 2003 09:15:18 +0100 (BST) From: Richard Huxton To: "Senthil Kumar S" , "psql" Subject: Re: Change column data type Date: Fri, 5 Sep 2003 09:15:18 +0100 User-Agent: KMail/1.5 References: <000c01c37137$a6e87ce0$7502a8c0@hdsc.com> In-Reply-To: <000c01c37137$a6e87ce0$7502a8c0@hdsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200309050915.18531.dev@archonet.com> X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/25 X-Sequence-Number: 15003 On Tuesday 02 September 2003 10:50, Senthil Kumar S wrote: > Dear Friends, > > Using Postgres 7.3.4 over the linux server 7.3. > > Is it possible to alter/change the data type of a existing table's column, > with out dropping and recreating a column of same name. > > Thanks for ur knowledge sharing. If you mean changing a varchar to a date or int4 to text, then no. If you want to change the size of a varchar field, people seem to have done that in the past (check the archives for details). Otherwise, you'll have to wrap the drop/recreate in a transaction along with whatever supporting updates you need. -- Richard Huxton Archonet Ltd