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-08-04 12:25:02 +08:00
|
|
|
create or replace function array_texteq(_text, text) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_texteq(_text, text) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_textregexeq(_text, text) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_textregexeq(_text, text) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
|
|
|
create operator *= (
|
|
|
|
leftarg=_text,
|
|
|
|
rightarg=text,
|
|
|
|
procedure=array_texteq);
|
|
|
|
|
|
|
|
create operator **= (
|
|
|
|
leftarg=_text,
|
|
|
|
rightarg=text,
|
|
|
|
procedure=array_all_texteq);
|
|
|
|
|
|
|
|
create operator *~ (
|
|
|
|
leftarg=_text,
|
|
|
|
rightarg=text,
|
|
|
|
procedure=array_textregexeq);
|
|
|
|
|
|
|
|
create operator **~ (
|
|
|
|
leftarg=_text,
|
|
|
|
rightarg=text,
|
|
|
|
procedure=array_all_textregexeq);
|
|
|
|
|
1999-01-22 06:40:16 +08:00
|
|
|
|
1999-06-06 03:09:48 +08:00
|
|
|
-- define the array operators *=, **=, *~ and **~ for type _varchar
|
1999-01-22 06:40:16 +08:00
|
|
|
--
|
1999-06-06 03:09:48 +08:00
|
|
|
-- NOTE: "varchar" is also a reserved word and must be quoted.
|
|
|
|
--
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_varchareq(_varchar, varchar) returns bool
|
1999-01-22 06:40:16 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_varchareq(_varchar, varchar) returns bool
|
1999-01-22 06:40:16 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_varcharregexeq(_varchar, varchar) returns bool
|
1999-01-22 06:40:16 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_varcharregexeq(_varchar, varchar) returns bool
|
1999-01-22 06:40:16 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
|
|
|
create operator *= (
|
1999-06-06 03:09:48 +08:00
|
|
|
leftarg=_varchar,
|
|
|
|
rightarg="varchar",
|
|
|
|
procedure=array_varchareq);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
|
|
|
create operator **= (
|
1999-06-06 03:09:48 +08:00
|
|
|
leftarg=_varchar,
|
|
|
|
rightarg="varchar",
|
|
|
|
procedure=array_all_varchareq);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
|
|
|
create operator *~ (
|
1999-06-06 03:09:48 +08:00
|
|
|
leftarg=_varchar,
|
|
|
|
rightarg="varchar",
|
|
|
|
procedure=array_varcharregexeq);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
|
|
|
create operator **~ (
|
1999-06-06 03:09:48 +08:00
|
|
|
leftarg=_varchar,
|
|
|
|
rightarg="varchar",
|
|
|
|
procedure=array_all_varcharregexeq);
|
|
|
|
|
|
|
|
|
|
|
|
-- define the array operators *=, **=, *~ and **~ for type _bpchar
|
|
|
|
--
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_bpchareq(_bpchar, bpchar) returns bool
|
1999-06-06 03:09:48 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1999-06-06 03:09:48 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_bpchareq(_bpchar, bpchar) returns bool
|
1999-06-06 03:09:48 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1999-06-06 03:09:48 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_bpcharregexeq(_bpchar, bpchar) returns bool
|
1999-06-06 03:09:48 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1999-06-06 03:09:48 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_bpcharregexeq(_bpchar, bpchar) returns bool
|
1999-06-06 03:09:48 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1999-06-06 03:09:48 +08:00
|
|
|
|
|
|
|
create operator *= (
|
|
|
|
leftarg=_bpchar,
|
|
|
|
rightarg=bpchar,
|
|
|
|
procedure=array_bpchareq);
|
|
|
|
|
|
|
|
create operator **= (
|
|
|
|
leftarg=_bpchar,
|
|
|
|
rightarg=bpchar,
|
|
|
|
procedure=array_all_bpchareq);
|
|
|
|
|
|
|
|
create operator *~ (
|
|
|
|
leftarg=_bpchar,
|
|
|
|
rightarg=bpchar,
|
|
|
|
procedure=array_bpcharregexeq);
|
|
|
|
|
|
|
|
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-08-04 12:25:02 +08:00
|
|
|
create or replace function array_int4eq(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_int4eq(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_int4ne(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_int4ne(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_int4gt(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_int4gt(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_int4ge(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_int4ge(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_int4lt(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_int4lt(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_int4le(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_int4le(_int4, int4) returns bool
|
1997-11-06 05:38:25 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1997-11-06 05:38:25 +08:00
|
|
|
|
|
|
|
create operator *= (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_int4eq);
|
|
|
|
|
|
|
|
create operator **= (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_all_int4eq);
|
|
|
|
|
|
|
|
create operator *<> (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_int4ne);
|
|
|
|
|
|
|
|
create operator **<> (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_all_int4ne);
|
|
|
|
|
|
|
|
create operator *> (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_int4gt);
|
|
|
|
|
|
|
|
create operator **> (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_all_int4gt);
|
|
|
|
|
|
|
|
create operator *>= (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_int4ge);
|
|
|
|
|
|
|
|
create operator **>= (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_all_int4ge);
|
|
|
|
|
|
|
|
create operator *< (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_int4lt);
|
|
|
|
|
|
|
|
create operator **< (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_all_int4lt);
|
|
|
|
|
|
|
|
create operator *<= (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_int4le);
|
|
|
|
|
|
|
|
create operator **<= (
|
|
|
|
leftarg=_int4,
|
|
|
|
rightarg=int4,
|
|
|
|
procedure=array_all_int4le);
|
|
|
|
|
1999-01-22 06:40:16 +08:00
|
|
|
-- define the array operators *=, **<> for type _oid (added tobias 1. 1999)
|
|
|
|
--
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_oideq(_oid, oid) returns bool
|
1999-01-22 06:40:16 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_all_oidne(_oid, oid) returns bool
|
1999-01-22 06:40:16 +08:00
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
1999-01-22 06:40:16 +08:00
|
|
|
|
|
|
|
create operator *= (
|
|
|
|
leftarg=_oid,
|
|
|
|
rightarg=oid,
|
|
|
|
procedure=array_oideq);
|
|
|
|
|
|
|
|
create operator **<> (
|
|
|
|
leftarg=_oid,
|
|
|
|
rightarg=oid,
|
|
|
|
procedure=array_all_oidne);
|
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
-- define the array operators *=, **=, *<>, **<> for type _inet
|
1999-01-22 06:40:16 +08:00
|
|
|
|
2002-08-04 12:25:02 +08:00
|
|
|
create or replace function array_ineteq(_inet, inet) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
2002-08-04 12:25:02 +08:00
|
|
|
|
|
|
|
create or replace function array_all_ineteq(_inet, inet) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
2002-08-04 12:25:02 +08:00
|
|
|
|
|
|
|
create or replace function array_inetne(_inet, inet) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
2002-08-04 12:25:02 +08:00
|
|
|
|
|
|
|
create or replace function array_all_inetne(_inet, inet) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
2002-08-27 01:54:02 +08:00
|
|
|
language C with (isStrict);
|
2002-08-04 12:25:02 +08:00
|
|
|
|
|
|
|
create operator *= (
|
|
|
|
leftarg=_inet,
|
|
|
|
rightarg=inet,
|
|
|
|
procedure=array_ineteq);
|
|
|
|
|
|
|
|
create operator **= (
|
|
|
|
leftarg=_inet,
|
|
|
|
rightarg=inet,
|
|
|
|
procedure=array_all_ineteq);
|
|
|
|
|
|
|
|
create operator *<> (
|
|
|
|
leftarg=_inet,
|
|
|
|
rightarg=inet,
|
|
|
|
procedure=array_inetne);
|
|
|
|
|
|
|
|
create operator **<> (
|
|
|
|
leftarg=_inet,
|
|
|
|
rightarg=inet,
|
|
|
|
procedure=array_all_inetne);
|