Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 5D48247683F for ; Tue, 7 May 2002 13:27:57 -0400 (EDT) Received: from leo.pcisys.net (leo.pcisys.net [207.76.102.240]) by postgresql.org (Postfix) with ESMTP id EB5BA4769F8 for ; Tue, 7 May 2002 12:18:55 -0400 (EDT) Received: from [208.202.106.237] (moe1.meg106-237.cos.pcisys.net [208.202.106.237]) by leo.pcisys.net (8.12.1/8.12.1) via ESMTP id g47GJ019000176 for ; Tue, 7 May 2002 10:19:00 -0600 (MDT) env-from (hierophant@pcisys.net) User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.0.4 Date: Tue, 07 May 2002 10:18:59 -0600 Subject: Re: type of a field From: Keary Suska To: Postgres-PHP Message-ID: In-Reply-To: <20020507130037.5405.qmail@web12603.mail.yahoo.com> Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Archive-Number: 200205/39 X-Sequence-Number: 1171 on 5/7/02 7:00 AM, ameen78101@yahoo.com purportedly said: > I want to change the type of a field in postgres . > How can I do it ? You can't, at least not exactly. I believe there is some info in either the FAQ, documentation, or non-FAQ documentation on the Postgres site. In essence, your choices are: 1) recreate the field: rename the current field, then create a new field with the same name and desired options; or 2) recreate the table: rename the current table, create a new table with the proper name and field definitions as desired, drop the old table. You can use SELECT INTO to transfer data from the old table to new. In both cases, however, you can run into problems with triggers and other server-side functions that use the field or table. I believe there are ways around this, but I don't recall them at the moment. Keary Suska Esoteritech, Inc. "Leveraging Open Source for a better Internet"