Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
ce3d0870
Commit
ce3d0870
authored
22 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
This patch adds support for inet[] arrays to the /contrib/array module.
Neil Conway
parent
0b15c252
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/array/array_iterator.c
+35
-1
35 additions, 1 deletion
contrib/array/array_iterator.c
contrib/array/array_iterator.h
+5
-0
5 additions, 0 deletions
contrib/array/array_iterator.h
contrib/array/array_iterator.sql.in
+62
-27
62 additions, 27 deletions
contrib/array/array_iterator.sql.in
with
102 additions
and
28 deletions
contrib/array/array_iterator.c
+
35
−
1
View file @
ce3d0870
...
@@ -361,7 +361,41 @@ array_all_oidne(ArrayType *array, Oid value)
...
@@ -361,7 +361,41 @@ array_all_oidne(ArrayType *array, Oid value)
array
,
(
Datum
)
value
);
array
,
(
Datum
)
value
);
}
}
/* end of file */
int32
array_ineteq
(
ArrayType
*
array
,
Oid
value
)
{
return
array_iterator
((
Oid
)
869
,
/* inet */
(
Oid
)
920
,
/* network_eq */
0
,
/* logical or */
array
,
(
Datum
)
value
);
}
int32
array_all_ineteq
(
ArrayType
*
array
,
Oid
value
)
{
return
array_iterator
((
Oid
)
869
,
/* inet */
(
Oid
)
920
,
/* network_eq */
1
,
/* logical and */
array
,
(
Datum
)
value
);
}
int32
array_inetne
(
ArrayType
*
array
,
Oid
value
)
{
return
array_iterator
((
Oid
)
869
,
/* inet */
(
Oid
)
925
,
/* network_ne */
0
,
/* logical and */
array
,
(
Datum
)
value
);
}
int32
array_all_inetne
(
ArrayType
*
array
,
Oid
value
)
{
return
array_iterator
((
Oid
)
869
,
/* inet */
(
Oid
)
925
,
/* network_ne */
1
,
/* logical and */
array
,
(
Datum
)
value
);
}
/*
/*
* Local Variables:
* Local Variables:
...
...
This diff is collapsed.
Click to expand it.
contrib/array/array_iterator.h
+
5
−
0
View file @
ce3d0870
...
@@ -34,6 +34,11 @@ int32 array_all_int4le(ArrayType *array, int4 value);
...
@@ -34,6 +34,11 @@ int32 array_all_int4le(ArrayType *array, int4 value);
int32
array_oideq
(
ArrayType
*
array
,
Oid
value
);
int32
array_oideq
(
ArrayType
*
array
,
Oid
value
);
int32
array_all_oidne
(
ArrayType
*
array
,
Oid
value
);
int32
array_all_oidne
(
ArrayType
*
array
,
Oid
value
);
int32
array_ineteq
(
ArrayType
*
array
,
Oid
value
);
int32
array_all_ineteq
(
ArrayType
*
array
,
Oid
value
);
int32
array_inetne
(
ArrayType
*
array
,
Oid
value
);
int32
array_all_inetne
(
ArrayType
*
array
,
Oid
value
);
#endif
#endif
/*
/*
...
...
This diff is collapsed.
Click to expand it.
contrib/array/array_iterator.sql.in
+
62
−
27
View file @
ce3d0870
...
@@ -2,19 +2,19 @@
...
@@ -2,19 +2,19 @@
-- define the array operators *=, **=, *~ and **~ for type _text
-- define the array operators *=, **=, *~ and **~ for type _text
--
--
create function array_texteq(_text, text) returns bool
create
or replace
function array_texteq(_text, text) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_texteq(_text, text) returns bool
create
or replace
function array_all_texteq(_text, text) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_textregexeq(_text, text) returns bool
create
or replace
function array_textregexeq(_text, text) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_textregexeq(_text, text) returns bool
create
or replace
function array_all_textregexeq(_text, text) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
...
@@ -43,19 +43,19 @@ create operator **~ (
...
@@ -43,19 +43,19 @@ create operator **~ (
--
--
-- NOTE: "varchar" is also a reserved word and must be quoted.
-- NOTE: "varchar" is also a reserved word and must be quoted.
--
--
create function array_varchareq(_varchar, varchar) returns bool
create
or replace
function array_varchareq(_varchar, varchar) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_varchareq(_varchar, varchar) returns bool
create
or replace
function array_all_varchareq(_varchar, varchar) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_varcharregexeq(_varchar, varchar) returns bool
create
or replace
function array_varcharregexeq(_varchar, varchar) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_varcharregexeq(_varchar, varchar) returns bool
create
or replace
function array_all_varcharregexeq(_varchar, varchar) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
...
@@ -82,19 +82,19 @@ create operator **~ (
...
@@ -82,19 +82,19 @@ create operator **~ (
-- define the array operators *=, **=, *~ and **~ for type _bpchar
-- define the array operators *=, **=, *~ and **~ for type _bpchar
--
--
create function array_bpchareq(_bpchar, bpchar) returns bool
create
or replace
function array_bpchareq(_bpchar, bpchar) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_bpchareq(_bpchar, bpchar) returns bool
create
or replace
function array_all_bpchareq(_bpchar, bpchar) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_bpcharregexeq(_bpchar, bpchar) returns bool
create
or replace
function array_bpcharregexeq(_bpchar, bpchar) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_bpcharregexeq(_bpchar, bpchar) returns bool
create
or replace
function array_all_bpcharregexeq(_bpchar, bpchar) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
...
@@ -121,51 +121,51 @@ create operator **~ (
...
@@ -121,51 +121,51 @@ create operator **~ (
-- define the array operators *=, **=, *> and **> for type _int4
-- define the array operators *=, **=, *> and **> for type _int4
--
--
create function array_int4eq(_int4, int4) returns bool
create
or replace
function array_int4eq(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_int4eq(_int4, int4) returns bool
create
or replace
function array_all_int4eq(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_int4ne(_int4, int4) returns bool
create
or replace
function array_int4ne(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_int4ne(_int4, int4) returns bool
create
or replace
function array_all_int4ne(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_int4gt(_int4, int4) returns bool
create
or replace
function array_int4gt(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_int4gt(_int4, int4) returns bool
create
or replace
function array_all_int4gt(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_int4ge(_int4, int4) returns bool
create
or replace
function array_int4ge(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_int4ge(_int4, int4) returns bool
create
or replace
function array_all_int4ge(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_int4lt(_int4, int4) returns bool
create
or replace
function array_int4lt(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_int4lt(_int4, int4) returns bool
create
or replace
function array_all_int4lt(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_int4le(_int4, int4) returns bool
create
or replace
function array_int4le(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_int4le(_int4, int4) returns bool
create
or replace
function array_all_int4le(_int4, int4) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
...
@@ -231,11 +231,11 @@ create operator **<= (
...
@@ -231,11 +231,11 @@ create operator **<= (
-- define the array operators *=, **<> for type _oid (added tobias 1. 1999)
-- define the array operators *=, **<> for type _oid (added tobias 1. 1999)
--
--
create function array_oideq(_oid, oid) returns bool
create
or replace
function array_oideq(_oid, oid) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
create function array_all_oidne(_oid, oid) returns bool
create
or replace
function array_all_oidne(_oid, oid) returns bool
as 'MODULE_PATHNAME'
as 'MODULE_PATHNAME'
language 'c';
language 'c';
...
@@ -249,5 +249,40 @@ create operator **<> (
...
@@ -249,5 +249,40 @@ create operator **<> (
rightarg=oid,
rightarg=oid,
procedure=array_all_oidne);
procedure=array_all_oidne);
-- define the array operators *=, **=, *<>, **<> for type _inet
-- end of file
create or replace function array_ineteq(_inet, inet) returns bool
as 'MODULE_PATHNAME'
language 'c';
create or replace function array_all_ineteq(_inet, inet) returns bool
as 'MODULE_PATHNAME'
language 'c';
create or replace function array_inetne(_inet, inet) returns bool
as 'MODULE_PATHNAME'
language 'c';
create or replace function array_all_inetne(_inet, inet) returns bool
as 'MODULE_PATHNAME'
language 'c';
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);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment