Skip site navigation (1) Skip section navigation (2)

Re: Type Categories for User-Defined Types

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Type Categories for User-Defined Types
Date: 2008-07-29 23:22:06
Message-ID: 559754CA-52DC-4D03-8BB1-18EB0F673122@kineticode.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Jul 29, 2008, at 15:35, Tom Lane wrote:

> BTW, I did confirm (by temporarily hacking up TypeCategory()) that
> causing citext to appear to be of STRING category eliminates the need
> for the extra || operator and quote_literal() function that are in
> the current citext code.  So the proposed solution really will work.

Nice! Does it also allow all of the casts to and from text to  
implicitly work, e.g,

SELECT 4::int8::citext = '4' AS t;
SELECT '4'::citext::int8 = 4 AS t;
SELECT 4::bigint::citext = '4' AS t;
SELECT '4'::citext::bigint = 4 AS t;

> You might still want to keep the aliases in cases where the point is  
> to
> have the function or operator output resolve as citext rather than  
> text.
> I'm not sure how many of these cases that's really important for,
> though.

Not many, I should think.

Thanks,

David


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-07-29 23:45:11
Subject: Re: Type Categories for User-Defined Types
Previous:From: Tom LaneDate: 2008-07-29 22:35:10
Subject: Re: Type Categories for User-Defined Types

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group