Commit 42be2c79 authored by Tom Lane's avatar Tom Lane

Adjust citext to make use of the new ability to declare its type category:

by putting it into the standard string category, we cause casts from citext
to text to be recognized as "preferred" casts.  This eliminates the need
for creation of alias functions and operators that only serve to prevent
ambiguous-function errors; get rid of the ones that were in the original
commit.
parent bac3e836
/* $PostgreSQL: pgsql/contrib/citext/citext.sql.in,v 1.1 2008/07/29 18:31:20 tgl Exp $ */
/* $PostgreSQL: pgsql/contrib/citext/citext.sql.in,v 1.2 2008/07/30 17:08:52 tgl Exp $ */
-- Adjust this setting to control where the objects get created.
SET search_path = public;
......@@ -49,7 +49,10 @@ CREATE TYPE citext (
RECEIVE = citextrecv,
SEND = citextsend,
INTERNALLENGTH = VARIABLE,
STORAGE = extended
STORAGE = extended,
-- make it a non-preferred member of string type category
CATEGORY = 'S',
PREFERRED = false
);
--
......@@ -106,12 +109,6 @@ RETURNS bool
AS 'MODULE_PATHNAME'
LANGUAGE C IMMUTABLE STRICT;
-- We overload || just to preserve "citext-ness" of the result.
CREATE OR REPLACE FUNCTION textcat(citext, citext)
RETURNS citext
AS 'textcat'
LANGUAGE 'internal' IMMUTABLE STRICT;
--
-- Operators.
--
......@@ -178,12 +175,6 @@ CREATE OPERATOR > (
JOIN = scalargtjoinsel
);
CREATE OPERATOR || (
LEFTARG = CITEXT,
RIGHTARG = CITEXT,
PROCEDURE = textcat
);
--
-- Support functions for indexing.
--
......@@ -246,25 +237,6 @@ CREATE AGGREGATE max(citext) (
SORTOP = >
);
--
-- Miscellaneous functions
-- These exist to preserve the "citext-ness" of the input.
--
CREATE OR REPLACE FUNCTION lower(citext)
RETURNS citext AS 'lower'
LANGUAGE 'internal' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION upper(citext)
RETURNS citext AS 'upper'
LANGUAGE 'internal' IMMUTABLE STRICT;
-- needed to avoid "function is not unique" errors
-- XXX find a better way to deal with this...
CREATE FUNCTION quote_literal(citext)
RETURNS text AS 'quote_literal'
LANGUAGE 'internal' IMMUTABLE STRICT;
--
-- CITEXT pattern matching.
--
......
/* $PostgreSQL: pgsql/contrib/citext/uninstall_citext.sql,v 1.1 2008/07/29 18:31:20 tgl Exp $ */
/* $PostgreSQL: pgsql/contrib/citext/uninstall_citext.sql,v 1.2 2008/07/30 17:08:52 tgl Exp $ */
-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
......@@ -15,7 +15,6 @@ DROP OPERATOR < (citext, citext);
DROP OPERATOR <= (citext, citext);
DROP OPERATOR >= (citext, citext);
DROP OPERATOR > (citext, citext);
DROP OPERATOR || (citext, citext);
DROP OPERATOR ~ (citext, citext);
DROP OPERATOR ~* (citext, citext);
......@@ -49,14 +48,10 @@ DROP FUNCTION citext_lt(citext, citext);
DROP FUNCTION citext_le(citext, citext);
DROP FUNCTION citext_gt(citext, citext);
DROP FUNCTION citext_ge(citext, citext);
DROP FUNCTION textcat(citext, citext);
DROP FUNCTION citext_cmp(citext, citext);
DROP FUNCTION citext_hash(citext);
DROP FUNCTION citext_smaller(citext, citext);
DROP FUNCTION citext_larger(citext, citext);
DROP FUNCTION lower(citext);
DROP FUNCTION upper(citext);
DROP FUNCTION quote_literal(citext);
DROP FUNCTION texticlike(citext, citext);
DROP FUNCTION texticnlike(citext, citext);
DROP FUNCTION texticregexeq(citext, citext);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment