Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 3292A476DAD for ; Tue, 7 May 2002 13:07:02 -0400 (EDT) Received: from mail1.ihs.com (unknown [170.207.70.222]) by postgresql.org (Postfix) with ESMTP id 94C97475EA3 for ; Tue, 7 May 2002 11:53:16 -0400 (EDT) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.3/8.12.3) with ESMTP id g47FpvK7029365; Tue, 7 May 2002 09:51:58 -0600 (MDT) Date: Tue, 7 May 2002 09:49:17 -0600 (MDT) From: Scott Marlowe To: ameen eetemadi Cc: Subject: Re: type of a field In-Reply-To: <20020507130037.5405.qmail@web12603.mail.yahoo.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-Archive-Number: 200205/37 X-Sequence-Number: 1169 Short answer: You can't Long answer: There are many workarounds. Workaround 1: dump the table with pg_dump dbase -t tablename edit dump file to change table definition drop and reload table. Workaround 2: Let's say you wanna change a varchar to a text type. Original table t1: col | type ---------- nam | varchar(32) id | int4 select nam::text, id into t2 from t1; drop table t1; alter table t2 rename to t1; You can do the above in a transaction if you are on a live database. I'd back up the data first just to be sure. On Tue, 7 May 2002, ameen eetemadi wrote: > I want to change the type of a field in postgres . > How can I do it ? > > __________________________________________________ > Do You Yahoo!? > Yahoo! Health - your guide to health and wellness > http://health.yahoo.com > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html >