| 1 |
/* contrib/citext/citext--1.0--1.1.sql */ |
| 2 |
|
| 3 |
-- complain if script is sourced in psql, rather than via ALTER EXTENSION |
| 4 |
\echo Use "ALTER EXTENSION citext UPDATE TO '1.1'" to load this file. \quit |
| 5 |
|
| 6 |
/* First we have to remove them from the extension */ |
| 7 |
ALTER EXTENSION citext DROP FUNCTION regexp_matches( citext, citext ); |
| 8 |
ALTER EXTENSION citext DROP FUNCTION regexp_matches( citext, citext, text ); |
| 9 |
|
| 10 |
/* Then we can drop them */ |
| 11 |
DROP FUNCTION regexp_matches( citext, citext ); |
| 12 |
DROP FUNCTION regexp_matches( citext, citext, text ); |
| 13 |
|
| 14 |
/* Now redefine */ |
| 15 |
CREATE FUNCTION regexp_matches( citext, citext ) RETURNS SETOF TEXT[] AS $$ |
| 16 |
SELECT pg_catalog.regexp_matches( $1::pg_catalog.text, $2::pg_catalog.text, 'i' ); |
| 17 |
$$ LANGUAGE SQL IMMUTABLE STRICT ROWS 1; |
| 18 |
|
| 19 |
CREATE FUNCTION regexp_matches( citext, citext, text ) RETURNS SETOF TEXT[] AS $$ |
| 20 |
SELECT pg_catalog.regexp_matches( $1::pg_catalog.text, $2::pg_catalog.text, CASE WHEN pg_catalog.strpos($3, 'c') = 0 THEN $3 || 'i' ELSE $3 END ); |
| 21 |
$$ LANGUAGE SQL IMMUTABLE STRICT ROWS 10; |