From: Erwin Moller <erwin@_no_spam_dexus.nl>
To: pgsql-admin@postgresql.org
Subject: Re: Untitled
Date: Wed, 26 Mar 2003 08:19:05 +0100
Message-ID: <3e81541b$0$49104$e4fe514c@news.xs4all.nl> (raw)
References: <20021212063914.50854.qmail@web13114.mail.yahoo.com>
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
>
>
>
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-admin@postgresql.org
Cc: erwin@_no_spam_dexus.nl
Subject: Re: Untitled
In-Reply-To: <3e81541b$0$49104$e4fe514c@news.xs4all.nl>
References: <20021212063914.50854.qmail@web13114.mail.yahoo.com> <3e81541b$0$49104$e4fe514c@news.xs4all.nl>
* 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