text and varchar

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: text and varchar
Date: 2004-07-21 15:52:13
Message-ID: Pine.LNX.4.44.0407211748080.2838-100000@zigo.dhs.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Why do we have both the type text and type varchar (without limit)?
Couldn't we make one to be an alias for the other?

Since it's 2 distinct types there are some strange effects:

dennis=> SELECT CAST ('123'::varchar AS integer);
ERROR: cannot cast type character varying to integer

dennis=> SELECT CAST ('123'::text AS integer);
int4
------
123

Sure, the cast is simple to fix. But why do we have two types in the first
place?

--
/Dennis Björklund

Browse pgsql-hackers by date

  From Date Subject
Next Message Matthew T. O'Connor 2004-07-21 16:32:22 Re: check point segments leakage ?
Previous Message Tom Lane 2004-07-21 15:42:29 Re: V3 protocol + DECLARE problems