Received: from megazone.bigpanda.com ([63.150.15.178]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fB725Am20448 for ; Thu, 6 Dec 2001 21:05:11 -0500 (EST) (envelope-from sszabo@megazone23.bigpanda.com) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 5DCFBD5F1; Thu, 6 Dec 2001 18:05:14 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 537FA5BED; Thu, 6 Dec 2001 18:05:14 -0800 (PST) Date: Thu, 6 Dec 2001 18:05:14 -0800 (PST) From: Stephan Szabo To: Christopher Kings-Lynne Cc: tinar , Subject: Re: how to chane the type In-Reply-To: Message-ID: <20011206180253.J30180-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200112/88 X-Sequence-Number: 5911 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).