X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 72C8B475CBC for ; Wed, 26 Mar 2003 02:20:10 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id D0A69474E44 for ; Wed, 26 Mar 2003 02:20:04 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id B818D43A611; Wed, 26 Mar 2003 02:20:04 -0500 (EST) Message-ID: <3e81541b$0$49104$e4fe514c@news.xs4all.nl> From: Erwin Moller Subject: Re: Untitled X-Newsgroups: comp.databases.postgresql.admin Date: Wed, 26 Mar 2003 08:19:05 +0100 References: <20021212063914.50854.qmail@web13114.mail.yahoo.com> Organization: Dexus User-Agent: KNode/0.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Lines: 38 X-Complaints-To: abuse@xs4all.nl To: pgsql-admin@postgresql.org X-Spam-Status: No, hits=-17.5 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,NO_DNS_FOR_FROM,REFERENCES, USER_AGENT 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/455 X-Sequence-Number: 8095 Mukund Pate wrote: > --0-762086988-1039675154=:50830 > Content-Type: text/plain; charset=us-ascii > > > hello, > > how to modify the datatype of column in a table? > > i have created table with one coulmn datatype is varchar(200) so i would > like to change to text datatype > Hi, Please take the time to fill in a subject next time you post. To your question: You cannot change the datatype in an existing table. If you are using Postgres 7.3 (next time you post please give us some backgroundinformation like your Postgresversion and OS) you can add a column of the texttype to your table and give a simple SQL-command to populate it. (UPDATE tblyourtable SET newcolumn=oldcolumn) Then drop the old column. If you are using triggers (Foreign keys for example) or indexes on the column, you better think it over first and recreate them afterwards. Regards, Erwin > thanks in advance > > mukund > > >