Re: Limited varchar, unlimited varchar, or text? - Mailing list pgsql-general

From Tom Lane
Subject Re: Limited varchar, unlimited varchar, or text?
Date
Msg-id 11677.1059068898@sss.pgh.pa.us
Whole thread Raw
In response to Re: Limited varchar, unlimited varchar, or text?  (Andrew Ayers <aayers@eldocomp.com>)
Responses Re: Limited varchar, unlimited varchar, or text?  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
Andrew Ayers <aayers@eldocomp.com> writes:
> Then people say "there is no difference, internally it is the same to PG".
> So - why the two types?

History.  TEXT was there first, VARCHAR was added for spec compliance.

> Personally, if such a change were to come about, I would lean toward
> adding the "TEXT(x)" to the system, and deprecating VARCHAR. Leave both
> in for a few versions, then rip VARCHAR support out. Why?

I can show you where the SQL spec says that we're not doing that.

I have myself been wondering if we couldn't converge the TEXT and
VARCHAR types some more, but we're not likely to remove either one.

            regards, tom lane

pgsql-general by date:

Previous
From: Vivek Khera
Date:
Subject: Re: dump_all/restore times?
Next
From: "Vernon Smith"
Date:
Subject: Re: SAP DB: The unsung Open Source DB