Re: Changing column data type on an existing table

From: Richard Huxton <dev(at)archonet(dot)com>
To: Joe Audette <joe_audette(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Changing column data type on an existing table
Date: 2005-05-14 08:17:29
Message-ID: 4285B419.5060108@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joe Audette wrote:
> Hi,
>
> I have an app that I released with a particular field
> as varchar 255.
>
> Can someone give me a script example I can use to make
> an upgrade script to change it to text or at least to
> larger varchar without losing existing data?

Others have answered for version 8.

If you are running one of the 7.x releases, you should google for
"pg_attribute atttypmod" and see how you can change that value to extend
varchars.

HTH

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jack Orenstein 2005-05-14 16:14:02 Why is psql \copy process stuck?
Previous Message Russell Smith 2005-05-14 01:07:32 Re: pgplsh on postgresql 8.0.2