1998-08-31 03:37:51 +08:00
|
|
|
-- array_iterator.sql --
|
|
|
|
--
|
|
|
|
-- SQL code to define the array iterator functions and operators.
|
|
|
|
--
|
|
|
|
-- Copyright (c) 1998, Massimo Dal Zotto <dz@cs.unitn.it>
|
|
|
|
--
|
|
|
|
-- This file is distributed under the GNU General Public License
|
|
|
|
-- either version 2, or (at your option) any later version.
|
1997-11-06 05:38:25 +08:00
|
|
|
|
1998-08-31 03:37:51 +08:00
|
|
|
-- Define the array functions *=, **=, *~ and **~ for type _text
|
1997-11-06 05:38:25 +08:00
|
|
|
--
|
|
|
|
create function array_texteq(_text, text) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_all_texteq(_text, text) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_textregexeq(_text, text) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_all_textregexeq(_text, text) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
1998-08-31 03:37:51 +08:00
|
|
|
-- Define the array functions *=, **=, *> and **> for type _int4
|
1997-11-06 05:38:25 +08:00
|
|
|
--
|
|
|
|
create function array_int4eq(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_all_int4eq(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_int4ne(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_all_int4ne(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_int4gt(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_all_int4gt(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_int4ge(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_all_int4ge(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_int4lt(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_all_int4lt(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_int4le(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
|
|
|
create function array_all_int4le(_int4, int4) returns bool
|
|
|
|
as 'MODULE_PATHNAME'
|
|
|
|
language 'c';
|
|
|
|
|
1998-08-31 03:37:51 +08:00
|
|
|
-- Define the operators corresponding to the above functions
|
|
|
|
--
|
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);
|
|
|
|
|
|
|
|
-- end of file
|