-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathasn1oid--1.sql
116 lines (116 loc) · 2.68 KB
/
asn1oid--1.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
CREATE TYPE asn1oid;
CREATE FUNCTION asn1oid_input (cstring)
RETURNS asn1oid
IMMUTABLE
STRICT
LANGUAGE C
AS 'asn1oid.so','asn1oid_input';
CREATE FUNCTION asn1oid_output (asn1oid)
RETURNS cstring
IMMUTABLE
STRICT
LANGUAGE C
AS 'asn1oid.so','asn1oid_output';
CREATE TYPE asn1oid (
INPUT = asn1oid_input,
OUTPUT = asn1oid_output);
CREATE FUNCTION asn1oid_eq (asn1oid, asn1oid)
RETURNS bool
IMMUTABLE
STRICT
LANGUAGE C
AS 'asn1oid.so','asn1oid_eq';
CREATE FUNCTION asn1oid_ne (asn1oid, asn1oid)
RETURNS bool
IMMUTABLE
STRICT
LANGUAGE C
AS 'asn1oid.so','asn1oid_ne';
CREATE FUNCTION asn1oid_lt (asn1oid, asn1oid)
RETURNS bool
IMMUTABLE
STRICT
LANGUAGE C
AS 'asn1oid.so','asn1oid_lt';
CREATE FUNCTION asn1oid_gt (asn1oid, asn1oid)
RETURNS bool
IMMUTABLE
STRICT
LANGUAGE C
AS 'asn1oid.so','asn1oid_gt';
CREATE FUNCTION asn1oid_le (asn1oid, asn1oid)
RETURNS bool
IMMUTABLE
STRICT
LANGUAGE C
AS 'asn1oid.so','asn1oid_le';
CREATE FUNCTION asn1oid_ge (asn1oid, asn1oid)
RETURNS bool
IMMUTABLE
STRICT
LANGUAGE C
AS 'asn1oid.so','asn1oid_ge';
CREATE FUNCTION asn1oid_cmp (asn1oid, asn1oid)
RETURNS int4
IMMUTABLE
STRICT
AS 'asn1oid.so','asn1oid_cmp' LANGUAGE C;
CREATE OPERATOR = (
LEFTARG = asn1oid,
RIGHTARG = asn1oid,
PROCEDURE = asn1oid_eq,
COMMUTATOR = '=',
NEGATOR = '<>',
RESTRICT = eqsel,
JOIN = eqjoinsel,
HASHES,
MERGES);
CREATE OPERATOR < (
LEFTARG = asn1oid,
RIGHTARG = asn1oid,
PROCEDURE = asn1oid_lt,
COMMUTATOR = '>',
NEGATOR = '>=',
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR > (
LEFTARG = asn1oid,
RIGHTARG = asn1oid,
PROCEDURE = asn1oid_gt,
COMMUTATOR = '<',
NEGATOR = '<=',
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR <= (
LEFTARG = asn1oid,
RIGHTARG = asn1oid,
PROCEDURE = asn1oid_le,
COMMUTATOR = '>=',
NEGATOR = '>',
RESTRICT = scalarltsel,
JOIN = scalarltjoinsel);
CREATE OPERATOR >= (
LEFTARG = asn1oid,
RIGHTARG = asn1oid,
PROCEDURE = asn1oid_ge,
COMMUTATOR = '<=',
NEGATOR = '<',
RESTRICT = scalargtsel,
JOIN = scalargtjoinsel);
CREATE OPERATOR <> (
LEFTARG = asn1oid,
RIGHTARG = asn1oid,
PROCEDURE = asn1oid_ne,
COMMUTATOR = '<>',
NEGATOR = '=',
RESTRICT = neqsel,
JOIN = neqjoinsel);
CREATE OPERATOR CLASS asn1oid_ops
DEFAULT FOR TYPE asn1oid
USING btree AS
OPERATOR 1 <,
OPERATOR 2 <=,
OPERATOR 3 =,
OPERATOR 4 >=,
OPERATOR 5 >,
FUNCTION 1 asn1oid_cmp(asn1oid, asn1oid);