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

Commit97a5a16

Browse files
committed
contrib/citext: Use SQL-standard function bodies.
In the same spirit as969bbd0,13e3796,3f323eb.Tom Lane and Ronan DunklauDiscussion:https://postgr.es/m/3316564.aeNJFYEL58@aivenlaptop
1 parenteb53ff5 commit97a5a16

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed

‎contrib/citext/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ MODULES = citext
44

55
EXTENSION = citext
66
DATA = citext--1.4.sql\
7+
citext--1.7--1.8.sql\
78
citext--1.6--1.7.sql\
89
citext--1.5--1.6.sql\
910
citext--1.4--1.5.sql\

‎contrib/citext/citext--1.7--1.8.sql

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/* contrib/citext/citext--1.7--1.8.sql*/
2+
3+
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
4+
\echo Use"ALTER EXTENSION citext UPDATE TO '1.8'" to load this file. \quit
5+
6+
CREATE OR REPLACEFUNCTIONregexp_match(string citext, pattern citext) RETURNSTEXT[]
7+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
8+
RETURNpg_catalog.regexp_match( $1::text, $2::text,'i' );
9+
10+
CREATE OR REPLACEFUNCTIONregexp_match(string citext, pattern citext, flagstext) RETURNSTEXT[]
11+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
12+
RETURNpg_catalog.regexp_match( $1::text, $2::text, CASE WHENpg_catalog.strpos($3,'c')=0 THEN $3||'i' ELSE $3 END );
13+
14+
CREATE OR REPLACEFUNCTIONregexp_matches(string citext, pattern citext) RETURNS SETOFTEXT[]
15+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE ROWS1
16+
RETURNpg_catalog.regexp_matches( $1::text, $2::text,'i' );
17+
18+
CREATE OR REPLACEFUNCTIONregexp_matches(string citext, pattern citext, flagstext) RETURNS SETOFTEXT[]
19+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE ROWS10
20+
RETURNpg_catalog.regexp_matches( $1::text, $2::text, CASE WHENpg_catalog.strpos($3,'c')=0 THEN $3||'i' ELSE $3 END );
21+
22+
CREATE OR REPLACEFUNCTIONregexp_replace(string citext, pattern citext, replacementtext) returnsTEXT
23+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
24+
RETURNpg_catalog.regexp_replace( $1::text, $2::text, $3,'i');
25+
26+
CREATE OR REPLACEFUNCTIONregexp_replace(string citext, pattern citext, replacementtext, flagstext) returnsTEXT
27+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
28+
RETURNpg_catalog.regexp_replace( $1::text, $2::text, $3, CASE WHENpg_catalog.strpos($4,'c')=0 THEN $4||'i' ELSE $4 END);
29+
30+
CREATE OR REPLACEFUNCTIONregexp_split_to_array(string citext, pattern citext) RETURNSTEXT[]
31+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
32+
RETURNpg_catalog.regexp_split_to_array( $1::text, $2::text,'i' );
33+
34+
CREATE OR REPLACEFUNCTIONregexp_split_to_array(string citext, pattern citext, flagstext) RETURNSTEXT[]
35+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
36+
RETURNpg_catalog.regexp_split_to_array( $1::text, $2::text, CASE WHENpg_catalog.strpos($3,'c')=0 THEN $3||'i' ELSE $3 END );
37+
38+
CREATE OR REPLACEFUNCTIONregexp_split_to_table(string citext, pattern citext) RETURNS SETOFTEXT
39+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
40+
RETURNpg_catalog.regexp_split_to_table( $1::text, $2::text,'i' );
41+
42+
CREATE OR REPLACEFUNCTIONregexp_split_to_table(string citext, pattern citext, flagstext) RETURNS SETOFTEXT
43+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
44+
RETURNpg_catalog.regexp_split_to_table( $1::text, $2::text, CASE WHENpg_catalog.strpos($3,'c')=0 THEN $3||'i' ELSE $3 END );
45+
46+
CREATE OR REPLACEFUNCTIONstrpos( citext, citext ) RETURNSINT
47+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
48+
RETURNpg_catalog.strpos(pg_catalog.lower( $1::text ),pg_catalog.lower( $2::text ) );
49+
50+
CREATE OR REPLACEFUNCTIONreplace( citext, citext, citext ) RETURNSTEXT
51+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
52+
RETURNpg_catalog.regexp_replace( $1::text,pg_catalog.regexp_replace($2::text,'([^a-zA-Z_0-9])', E'\\\\\\1','g'), $3::text,'gi' );
53+
54+
CREATE OR REPLACEFUNCTIONsplit_part( citext, citext,int ) RETURNSTEXT
55+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
56+
RETURN (pg_catalog.regexp_split_to_array( $1::text,pg_catalog.regexp_replace($2::text,'([^a-zA-Z_0-9])', E'\\\\\\1','g'),'i'))[$3];
57+
58+
CREATE OR REPLACEFUNCTIONtranslate( citext, citext,text ) RETURNSTEXT
59+
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE
60+
RETURNpg_catalog.translate(pg_catalog.translate( $1::text,pg_catalog.lower($2::text), $3),pg_catalog.upper($2::text), $3);

‎contrib/citext/citext.control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# citext extension
22
comment = 'data type for case-insensitive character strings'
3-
default_version = '1.7'
3+
default_version = '1.8'
44
module_pathname = '$libdir/citext'
55
relocatable = true
66
trusted = true

‎contrib/citext/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ install_data(
2626
'citext--1.4--1.5.sql',
2727
'citext--1.5--1.6.sql',
2828
'citext--1.6--1.7.sql',
29+
'citext--1.7--1.8.sql',
2930
kwargs: contrib_data_args,
3031
)
3132

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp