gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
1.0KB

  1. /* contrib/citext/citext--1.0--1.1.sql */
  2. -- complain if script is sourced in psql, rather than via ALTER EXTENSION
  3. \echo Use "ALTER EXTENSION citext UPDATE TO '1.1'" to load this file. \quit
  4. /* First we have to remove them from the extension */
  5. ALTER EXTENSION citext DROP FUNCTION regexp_matches( citext, citext );
  6. ALTER EXTENSION citext DROP FUNCTION regexp_matches( citext, citext, text );
  7. /* Then we can drop them */
  8. DROP FUNCTION regexp_matches( citext, citext );
  9. DROP FUNCTION regexp_matches( citext, citext, text );
  10. /* Now redefine */
  11. CREATE FUNCTION regexp_matches( citext, citext ) RETURNS SETOF TEXT[] AS $$
  12. SELECT pg_catalog.regexp_matches( $1::pg_catalog.text, $2::pg_catalog.text, 'i' );
  13. $$ LANGUAGE SQL IMMUTABLE STRICT ROWS 1;
  14. CREATE FUNCTION regexp_matches( citext, citext, text ) RETURNS SETOF TEXT[] AS $$
  15. 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 );
  16. $$ LANGUAGE SQL IMMUTABLE STRICT ROWS 10;
上海开阖软件有限公司 沪ICP备12045867号-1