1999-01-22 06:40:16 +08:00
|
|
|
-- SQL code to define the new array iterator functions and operators
|
1997-11-06 05:38:25 +08:00
|
|
|
|
1999-01-22 06:40:16 +08:00
|
|
|
-- define the array operators *=, **=, *~ and **~ for type _text
|
1997-11-06 05:38:25 +08:00
|
|
|
--
|
|
|
|
|
2002-10-19 02:41:22 +08:00
|
|
|
-- Adjust this setting to control where the objects get created.
|
|
|
|
SET search_path = public;
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OR REPLACE FUNCTION array_texteq(_text, text)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OR REPLACE FUNCTION array_all_texteq(_text, text)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OR REPLACE FUNCTION array_textregexeq(_text, text)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OR REPLACE FUNCTION array_all_textregexeq(_text, text)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *=(_text,text);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *= (
|
|
|
|
LEFTARG=_text,
|
|
|
|
RIGHTARG=text,
|
|
|
|
PROCEDURE=array_texteq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **=(_text,text);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **= (
|
|
|
|
LEFTARG=_text,
|
|
|
|
RIGHTARG=text,
|
|
|
|
PROCEDURE=array_all_texteq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *~(_text,text);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *~ (
|
|
|
|
LEFTARG=_text,
|
|
|
|
RIGHTARG=text,
|
|
|
|
PROCEDURE=array_textregexeq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **~(_text,text);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **~ (
|
|
|
|
LEFTARG=_text,
|
|
|
|
RIGHTARG=text,
|
|
|
|
PROCEDURE=array_all_textregexeq
|
|
|
|
);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
1999-01-22 06:40:16 +08:00
|
|
|
|
1999-06-06 03:09:48 +08:00
|
|
|
-- define the array operators *=, **=, *~ and **~ for type _bpchar
|
|
|
|
--
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OR REPLACE FUNCTION array_bpchareq(_bpchar, bpchar)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_bpchareq(_bpchar, bpchar)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_bpcharregexeq(_bpchar, bpchar)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_bpcharregexeq(_bpchar, bpchar)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *=(_bpchar,bpchar);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *= (
|
|
|
|
LEFTARG=_bpchar,
|
|
|
|
RIGHTARG=bpchar,
|
|
|
|
PROCEDURE=array_bpchareq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **=(_bpchar,bpchar);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **= (
|
|
|
|
LEFTARG=_bpchar,
|
|
|
|
RIGHTARG=bpchar,
|
|
|
|
PROCEDURE=array_all_bpchareq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *~(_bpchar,bpchar);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *~ (
|
|
|
|
LEFTARG=_bpchar,
|
|
|
|
RIGHTARG=bpchar,
|
|
|
|
PROCEDURE=array_bpcharregexeq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **~(_bpchar,bpchar);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **~ (
|
|
|
|
LEFTARG=_bpchar,
|
|
|
|
RIGHTARG=bpchar,
|
|
|
|
PROCEDURE=array_all_bpcharregexeq
|
|
|
|
);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
|
|
|
|
|
|
|
-- define the array operators *=, **=, *> and **> for type _int4
|
1997-11-06 05:38:25 +08:00
|
|
|
--
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OR REPLACE FUNCTION array_int4eq(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_int4eq(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_int4ne(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_int4ne(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_int4gt(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_int4gt(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_int4ge(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_int4ge(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_int4lt(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_int4lt(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_int4le(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_int4le(_int4, int4)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *=(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *= (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_int4eq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **=(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **= (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_all_int4eq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *<>(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *<> (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_int4ne
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **<>(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **<> (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_all_int4ne
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *>(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *> (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_int4gt
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **>(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **> (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_all_int4gt
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *>=(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *>= (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_int4ge
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **>=(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **>= (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_all_int4ge
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *<(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *< (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_int4lt
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **<(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **< (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_all_int4lt
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *<=(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *<= (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_int4le
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **<=(_int4,int4);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **<= (
|
|
|
|
LEFTARG=_int4,
|
|
|
|
RIGHTARG=int4,
|
|
|
|
PROCEDURE=array_all_int4le
|
|
|
|
);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
1999-01-22 06:40:16 +08:00
|
|
|
-- define the array operators *=, **<> for type _oid (added tobias 1. 1999)
|
|
|
|
--
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OR REPLACE FUNCTION array_oideq(_oid, oid)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_oidne(_oid, oid)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *=(_oid,oid);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *= (
|
|
|
|
LEFTARG=_oid,
|
|
|
|
RIGHTARG=oid,
|
|
|
|
PROCEDURE=array_oideq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **<>(_oid,oid);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **<> (
|
|
|
|
LEFTARG=_oid,
|
|
|
|
RIGHTARG=oid,
|
|
|
|
PROCEDURE=array_all_oidne
|
|
|
|
);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
-- define the array operators *=, **=, *<>, **<> for type _inet
|
1999-01-22 06:40:16 +08:00
|
|
|
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OR REPLACE FUNCTION array_ineteq(_inet, inet)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_ineteq(_inet, inet)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_inetne(_inet, inet)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
|
|
|
CREATE OR REPLACE FUNCTION array_all_inetne(_inet, inet)
|
|
|
|
RETURNS bool
|
|
|
|
AS 'MODULE_PATHNAME'
|
2003-03-20 12:39:27 +08:00
|
|
|
LANGUAGE 'C' IMMUTABLE STRICT;
|
2002-10-19 02:41:22 +08:00
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *=(_inet,inet);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *= (
|
|
|
|
LEFTARG=_inet,
|
|
|
|
RIGHTARG=inet,
|
|
|
|
PROCEDURE=array_ineteq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **=(_inet,inet);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **= (
|
|
|
|
LEFTARG=_inet,
|
|
|
|
RIGHTARG=inet,
|
|
|
|
PROCEDURE=array_all_ineteq
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR *<>(_inet,inet);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR *<> (
|
|
|
|
LEFTARG=_inet,
|
|
|
|
RIGHTARG=inet,
|
|
|
|
PROCEDURE=array_inetne
|
|
|
|
);
|
|
|
|
|
2003-03-20 12:39:27 +08:00
|
|
|
DROP OPERATOR **<>(_inet,inet);
|
2002-10-19 02:41:22 +08:00
|
|
|
CREATE OPERATOR **<> (
|
|
|
|
LEFTARG=_inet,
|
|
|
|
RIGHTARG=inet,
|
|
|
|
PROCEDURE=array_all_inetne
|
|
|
|
);
|