From: Keary Suska <hierophant@pcisys.net>
To: Postgres-PHP <pgsql-php@postgresql.org>
Subject: Re: type of a field
Date: Tue, 07 May 2002 10:18:59 -0600
Message-ID: <B8FD5A93.E203%hierophant@pcisys.net> (raw)
In-Reply-To: <20020507130037.5405.qmail@web12603.mail.yahoo.com>
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"
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: hierophant@pcisys.net
Subject: Re: type of a field
In-Reply-To: <B8FD5A93.E203%hierophant@pcisys.net>
References: <20020507130037.5405.qmail@web12603.mail.yahoo.com> <B8FD5A93.E203%hierophant@pcisys.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox