mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
27b8143944
I have updated my contrib code for version 6.5. In the attachment you will find the directories array, datetime, miscutil, string, tools and userlocks which replace the corresponding directories under contrib. In contrib/tools you will find some developement scripts which I use while hacking the sources. I hope they will be useful for some other people. I have also added a contrib/Makefile which tries to compile and install all the contribs. Unfortunately many of them don't have a Makefile or don't compile cleanly. -- Massimo Dal Zotto
254 lines
5.3 KiB
MySQL
254 lines
5.3 KiB
MySQL
-- SQL code to define the new array iterator functions and operators
|
|
|
|
-- define the array operators *=, **=, *~ and **~ for type _text
|
|
--
|
|
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);
|
|
|
|
|
|
-- define the array operators *=, **=, *~ and **~ for type _varchar
|
|
--
|
|
-- NOTE: "varchar" is also a reserved word and must be quoted.
|
|
--
|
|
create function array_varchareq(_varchar, varchar) returns bool
|
|
as 'MODULE_PATHNAME'
|
|
language 'c';
|
|
|
|
create function array_all_varchareq(_varchar, varchar) returns bool
|
|
as 'MODULE_PATHNAME'
|
|
language 'c';
|
|
|
|
create function array_varcharregexeq(_varchar, varchar) returns bool
|
|
as 'MODULE_PATHNAME'
|
|
language 'c';
|
|
|
|
create function array_all_varcharregexeq(_varchar, varchar) returns bool
|
|
as 'MODULE_PATHNAME'
|
|
language 'c';
|
|
|
|
create operator *= (
|
|
leftarg=_varchar,
|
|
rightarg="varchar",
|
|
procedure=array_varchareq);
|
|
|
|
create operator **= (
|
|
leftarg=_varchar,
|
|
rightarg="varchar",
|
|
procedure=array_all_varchareq);
|
|
|
|
create operator *~ (
|
|
leftarg=_varchar,
|
|
rightarg="varchar",
|
|
procedure=array_varcharregexeq);
|
|
|
|
create operator **~ (
|
|
leftarg=_varchar,
|
|
rightarg="varchar",
|
|
procedure=array_all_varcharregexeq);
|
|
|
|
|
|
-- define the array operators *=, **=, *~ and **~ for type _bpchar
|
|
--
|
|
create function array_bpchareq(_bpchar, bpchar) returns bool
|
|
as 'MODULE_PATHNAME'
|
|
language 'c';
|
|
|
|
create function array_all_bpchareq(_bpchar, bpchar) returns bool
|
|
as 'MODULE_PATHNAME'
|
|
language 'c';
|
|
|
|
create function array_bpcharregexeq(_bpchar, bpchar) returns bool
|
|
as 'MODULE_PATHNAME'
|
|
language 'c';
|
|
|
|
create function array_all_bpcharregexeq(_bpchar, bpchar) returns bool
|
|
as 'MODULE_PATHNAME'
|
|
language 'c';
|
|
|
|
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);
|
|
|
|
|
|
-- define the array operators *=, **=, *> and **> for type _int4
|
|
--
|
|
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';
|
|
|
|
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);
|
|
|
|
-- define the array operators *=, **<> for type _oid (added tobias 1. 1999)
|
|
--
|
|
create function array_oideq(_oid, oid) returns bool
|
|
as 'MODULE_PATHNAME'
|
|
language 'c';
|
|
|
|
create function array_all_oidne(_oid, oid) returns bool
|
|
as 'MODULE_PATHNAME'
|
|
language 'c';
|
|
|
|
create operator *= (
|
|
leftarg=_oid,
|
|
rightarg=oid,
|
|
procedure=array_oideq);
|
|
|
|
create operator **<> (
|
|
leftarg=_oid,
|
|
rightarg=oid,
|
|
procedure=array_all_oidne);
|
|
|
|
|
|
-- end of file
|