Converting varchar() to text - Mailing list pgsql-general

From Steve Atkins
Subject Converting varchar() to text
Date
Msg-id 20040915162913.GA10752@gp.word-to-the-wise.com
Whole thread Raw
Responses Re: Converting varchar() to text
List pgsql-general
Is there a safe way to convert varchar(n) to text, other than create
a new column, update, delete column, rename?

I have a number of databases that were built with varvhar(n) and which
should have been done with text. They're in production, and I'd rather
not take the downtime needed to convert some rather large tables - the
bulk update hitting every row of the large table makes it effectively
unvacuumable, and vacuum full requires locks that effectively shut
down the entire system.

They're the same format on disk, so I'm guessing that some diddling
with pg_attribute may be possible. Does anyone have any experience
doing this?

Cheers,
  Steve


pgsql-general by date:

Previous
From: "Jeffrey W. Baker"
Date:
Subject: Re: disk performance benchmarks
Next
From: Greg Donald
Date:
Subject: division by zero issue