Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit42be2c7

Browse files
committed
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 citextto text to be recognized as "preferred" casts. This eliminates the needfor creation of alias functions and operators that only serve to preventambiguous-function errors; get rid of the ones that were in the originalcommit.
1 parentbac3e83 commit42be2c7

File tree

2 files changed

+6
-39
lines changed

2 files changed

+6
-39
lines changed

‎contrib/citext/citext.sql.in

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/contrib/citext/citext.sql.in,v 1.1 2008/07/29 18:31:20 tgl Exp $ */
1+
/* $PostgreSQL: pgsql/contrib/citext/citext.sql.in,v 1.2 2008/07/30 17:08:52 tgl Exp $ */
22

33
-- Adjust this setting to control where the objects get created.
44
SET search_path = public;
@@ -49,7 +49,10 @@ CREATE TYPE citext (
4949
RECEIVE = citextrecv,
5050
SEND = citextsend,
5151
INTERNALLENGTH = VARIABLE,
52-
STORAGE = extended
52+
STORAGE = extended,
53+
-- make it a non-preferred member of string type category
54+
CATEGORY = 'S',
55+
PREFERRED = false
5356
);
5457

5558
--
@@ -106,12 +109,6 @@ RETURNS bool
106109
AS 'MODULE_PATHNAME'
107110
LANGUAGE C IMMUTABLE STRICT;
108111

109-
-- We overload || just to preserve "citext-ness" of the result.
110-
CREATE OR REPLACE FUNCTION textcat(citext, citext)
111-
RETURNS citext
112-
AS 'textcat'
113-
LANGUAGE 'internal' IMMUTABLE STRICT;
114-
115112
--
116113
-- Operators.
117114
--
@@ -178,12 +175,6 @@ CREATE OPERATOR > (
178175
JOIN = scalargtjoinsel
179176
);
180177

181-
CREATE OPERATOR || (
182-
LEFTARG = CITEXT,
183-
RIGHTARG = CITEXT,
184-
PROCEDURE = textcat
185-
);
186-
187178
--
188179
-- Support functions for indexing.
189180
--
@@ -246,25 +237,6 @@ CREATE AGGREGATE max(citext) (
246237
SORTOP = >
247238
);
248239

249-
--
250-
-- Miscellaneous functions
251-
-- These exist to preserve the "citext-ness" of the input.
252-
--
253-
254-
CREATE OR REPLACE FUNCTION lower(citext)
255-
RETURNS citext AS 'lower'
256-
LANGUAGE 'internal' IMMUTABLE STRICT;
257-
258-
CREATE OR REPLACE FUNCTION upper(citext)
259-
RETURNS citext AS 'upper'
260-
LANGUAGE 'internal' IMMUTABLE STRICT;
261-
262-
-- needed to avoid "function is not unique" errors
263-
-- XXX find a better way to deal with this...
264-
CREATE FUNCTION quote_literal(citext)
265-
RETURNS text AS 'quote_literal'
266-
LANGUAGE 'internal' IMMUTABLE STRICT;
267-
268240
--
269241
-- CITEXT pattern matching.
270242
--

‎contrib/citext/uninstall_citext.sql

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/contrib/citext/uninstall_citext.sql,v 1.1 2008/07/29 18:31:20 tgl Exp $*/
1+
/* $PostgreSQL: pgsql/contrib/citext/uninstall_citext.sql,v 1.2 2008/07/30 17:08:52 tgl Exp $*/
22

33
-- Adjust this setting to control where the objects get dropped.
44
SET search_path= public;
@@ -15,7 +15,6 @@ DROP OPERATOR < (citext, citext);
1515
DROPOPERATOR<= (citext, citext);
1616
DROPOPERATOR>= (citext, citext);
1717
DROPOPERATOR> (citext, citext);
18-
DROPOPERATOR|| (citext, citext);
1918

2019
DROPOPERATOR ~ (citext, citext);
2120
DROPOPERATOR ~* (citext, citext);
@@ -49,14 +48,10 @@ DROP FUNCTION citext_lt(citext, citext);
4948
DROPFUNCTION citext_le(citext, citext);
5049
DROPFUNCTION citext_gt(citext, citext);
5150
DROPFUNCTION citext_ge(citext, citext);
52-
DROPFUNCTION textcat(citext, citext);
5351
DROPFUNCTION citext_cmp(citext, citext);
5452
DROPFUNCTION citext_hash(citext);
5553
DROPFUNCTION citext_smaller(citext, citext);
5654
DROPFUNCTION citext_larger(citext, citext);
57-
DROPFUNCTIONlower(citext);
58-
DROPFUNCTIONupper(citext);
59-
DROPFUNCTION quote_literal(citext);
6055
DROPFUNCTION texticlike(citext, citext);
6156
DROPFUNCTION texticnlike(citext, citext);
6257
DROPFUNCTION texticregexeq(citext, citext);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp