| 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 REPLACE FUNCTION regexp_match(string citext, pattern citext) RETURNS TEXT[] |
| 7 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 8 |
RETURN pg_catalog.regexp_match( $1::text, $2::text, 'i' ); |
| 9 |
|
| 10 |
CREATE OR REPLACE FUNCTION regexp_match(string citext, pattern citext, flags text) RETURNS TEXT[] |
| 11 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 12 |
RETURN pg_catalog.regexp_match( $1::text, $2::text, CASE WHEN pg_catalog.strpos($3, 'c') = 0 THEN $3 || 'i' ELSE $3 END ); |
| 13 |
|
| 14 |
CREATE OR REPLACE FUNCTION regexp_matches(string citext, pattern citext) RETURNS SETOF TEXT[] |
| 15 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE ROWS 1 |
| 16 |
RETURN pg_catalog.regexp_matches( $1::text, $2::text, 'i' ); |
| 17 |
|
| 18 |
CREATE OR REPLACE FUNCTION regexp_matches(string citext, pattern citext, flags text) RETURNS SETOF TEXT[] |
| 19 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE ROWS 10 |
| 20 |
RETURN pg_catalog.regexp_matches( $1::text, $2::text, CASE WHEN pg_catalog.strpos($3, 'c') = 0 THEN $3 || 'i' ELSE $3 END ); |
| 21 |
|
| 22 |
CREATE OR REPLACE FUNCTION regexp_replace(string citext, pattern citext, replacement text) returns TEXT |
| 23 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 24 |
RETURN pg_catalog.regexp_replace( $1::text, $2::text, $3, 'i'); |
| 25 |
|
| 26 |
CREATE OR REPLACE FUNCTION regexp_replace(string citext, pattern citext, replacement text, flags text) returns TEXT |
| 27 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 28 |
RETURN pg_catalog.regexp_replace( $1::text, $2::text, $3, CASE WHEN pg_catalog.strpos($4, 'c') = 0 THEN $4 || 'i' ELSE $4 END); |
| 29 |
|
| 30 |
CREATE OR REPLACE FUNCTION regexp_split_to_array(string citext, pattern citext) RETURNS TEXT[] |
| 31 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 32 |
RETURN pg_catalog.regexp_split_to_array( $1::text, $2::text, 'i' ); |
| 33 |
|
| 34 |
CREATE OR REPLACE FUNCTION regexp_split_to_array(string citext, pattern citext, flags text) RETURNS TEXT[] |
| 35 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 36 |
RETURN pg_catalog.regexp_split_to_array( $1::text, $2::text, CASE WHEN pg_catalog.strpos($3, 'c') = 0 THEN $3 || 'i' ELSE $3 END ); |
| 37 |
|
| 38 |
CREATE OR REPLACE FUNCTION regexp_split_to_table(string citext, pattern citext) RETURNS SETOF TEXT |
| 39 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 40 |
RETURN pg_catalog.regexp_split_to_table( $1::text, $2::text, 'i' ); |
| 41 |
|
| 42 |
CREATE OR REPLACE FUNCTION regexp_split_to_table(string citext, pattern citext, flags text) RETURNS SETOF TEXT |
| 43 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 44 |
RETURN pg_catalog.regexp_split_to_table( $1::text, $2::text, CASE WHEN pg_catalog.strpos($3, 'c') = 0 THEN $3 || 'i' ELSE $3 END ); |
| 45 |
|
| 46 |
CREATE OR REPLACE FUNCTION strpos( citext, citext ) RETURNS INT |
| 47 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 48 |
RETURN pg_catalog.strpos( pg_catalog.lower( $1::text ), pg_catalog.lower( $2::text ) ); |
| 49 |
|
| 50 |
CREATE OR REPLACE FUNCTION replace( citext, citext, citext ) RETURNS TEXT |
| 51 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 52 |
RETURN pg_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 REPLACE FUNCTION split_part( citext, citext, int ) RETURNS TEXT |
| 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 REPLACE FUNCTION translate( citext, citext, text ) RETURNS TEXT |
| 59 |
LANGUAGE SQL IMMUTABLE STRICT PARALLEL SAFE |
| 60 |
RETURN pg_catalog.translate( pg_catalog.translate( $1::text, pg_catalog.lower($2::text), $3), pg_catalog.upper($2::text), $3); |