X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 54141D1B462 for ; Wed, 17 Dec 2003 08:02:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 83533-09 for ; Wed, 17 Dec 2003 04:02:19 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 2E502D1C980 for ; Wed, 17 Dec 2003 04:02:17 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id hBH82I19025916; Wed, 17 Dec 2003 03:02:18 -0500 (EST) To: Jodi Kanter Cc: Postgres Admin List Subject: Re: character type modification In-reply-to: <3FDF4195.6040804@virginia.edu> References: <3FDF4195.6040804@virginia.edu> Comments: In-reply-to Jodi Kanter message dated "Tue, 16 Dec 2003 12:32:05 -0500" Date: Wed, 17 Dec 2003 03:02:18 -0500 Message-ID: <25915.1071648138@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/232 X-Sequence-Number: 11738 Jodi Kanter writes: > Can I alter a column from character varying(128) to text without having > to create a temp table? I am running 7.3.3. Yeah, if you're brave enough: change the column's atttypid to 'text' (25, I think, but check it) and atttypmod to -1 in pg_attribute. This is sufficient since the two datatypes have the same representation --- in general you can't just hack atttypid at random, but it will work in this case. Highly advisable to practice this maneuver in a scratch database. BTW, if you're running 7.3.3 and not 7.3.4 (even better 7.3.5), you are not being brave but foolish. 7.3.3's WAL-startup-failure bug will get you sooner or later. regards, tom lane