From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
Cc: tinar <tinarajraj@hotmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: how to chane the type
Date: Thu, 6 Dec 2001 18:05:14 -0800 (PST)
Message-ID: <20011206180253.J30180-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <GNELIHDDFBOCMGBFGEFOMEKMCAAA.chriskl@familyhealth.com.au>
On Fri, 7 Dec 2001, Christopher Kings-Lynne wrote:
> What's the essential problem with changing column types in postgres? Is it
> similar to the DROP COLUMN problem?
>
> If the answer is that the table format only has allocated enough space per
> row for the existing type, then how is it possible that Stephen's hack below
> will not break things?
The hack below only works to change the max length of variable length
attributes and only upward. I'd be very wary of trying to change the real
type of a value except between ones that are bitwise compatible (like I
think varchar and text are technically, but I'm not sure).
> > The best way is to recreate the table and rename
> > them around. If you *REALLY* don't want to do
> > that and have a recent backup (yes, I'm serious),
> > you can muck with pg_attribute and change
> > atttypmod for the attribute in question
> > (from 14 to 34).
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: sszabo@megazone23.bigpanda.com, chriskl@familyhealth.com.au, tinarajraj@hotmail.com
Subject: Re: how to chane the type
In-Reply-To: <20011206180253.J30180-100000@megazone23.bigpanda.com>
* 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