Re: Difference between varchar and text? - Mailing list pgsql-general

From Vick Khera
Subject Re: Difference between varchar and text?
Date
Msg-id CALd+dcewTsp+d1hx0nk+19e10gpsFA=v=NUpe92Yfs31Vx701w@mail.gmail.com
Whole thread Raw
In response to Re: Difference between varchar and text?  (Craig Ringer <craig@2ndQuadrant.com>)
Responses Re: Difference between varchar and text?
List pgsql-general
On Sun, Nov 18, 2012 at 7:24 PM, Craig Ringer <craig@2ndquadrant.com> wrote:
On 11/19/2012 12:57 AM, Vick Khera wrote:


On Sun, Nov 18, 2012 at 2:29 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
I'd generally recommend using "text" if you don't have any interest in
enforcing a specific length limit.

Will there be any table re-writing if I do an alter to change the column type from varchar(N) to text?  I have some really old (from 2000 and 2001) schemas that have a metric boatload of data in them, and I'd like to remove the old artificial limit on them.
That depends on the PostgreSQL version. Some changes were made to improve that recently; from memory, it used to require rewriting, so people would sometimes work around it with (dodgy and unsafe) hacks directly to the system catalogs. I'm not sure if "recently" is 9.2 or 9.3.


I'm looking at 9.0 in production right now..  Perhaps I will just use this as an opportunity to upgrade to 9.2 and slony 2.1. :) 

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Difference between varchar and text?
Next
From: Jeff Janes
Date:
Subject: Re: Difference between varchar and text?