Project

General

Profile

« Previous | Next » 

Revision 13794

schemas/util.sql: operator functions: renamed to plain-text names to follow the Postgres convention of making the function name be the human-readable name of the operator

View differences:

trunk/schemas/util.sql
91 91

  
92 92

  
93 93
--
94
-- Name: %==(anyelement, anyelement); Type: FUNCTION; Schema: util; Owner: -
95
--
96

  
97
CREATE FUNCTION "%=="(left_ anyelement, right_ anyelement) RETURNS boolean
98
    LANGUAGE sql STABLE
99
    AS $_$
100
SELECT keys($1) = keys($2)
101
$_$;
102

  
103

  
104
--
105
-- Name: FUNCTION "%=="(left_ anyelement, right_ anyelement); Type: COMMENT; Schema: util; Owner: -
106
--
107

  
108
COMMENT ON FUNCTION "%=="(left_ anyelement, right_ anyelement) IS '
109
needs to be declared STABLE instead of IMMUTABLE because it depends on the search_path (as described at http://vegpath.org/links/#PostgreSQL:%20Documentation:%209.3:%20Function%20Volatility%20Categories%20**)
110
';
111

  
112

  
113
--
114 94
-- Name: _alt(anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement, anyelement); Type: FUNCTION; Schema: util; Owner: -
115 95
--
116 96

  
......
2178 2158

  
2179 2159

  
2180 2160
--
2161
-- Name: keys_eq(anyelement, anyelement); Type: FUNCTION; Schema: util; Owner: -
2162
--
2163

  
2164
CREATE FUNCTION keys_eq(left_ anyelement, right_ anyelement) RETURNS boolean
2165
    LANGUAGE sql STABLE
2166
    AS $_$
2167
SELECT keys($1) = keys($2)
2168
$_$;
2169

  
2170

  
2171
--
2172
-- Name: FUNCTION keys_eq(left_ anyelement, right_ anyelement); Type: COMMENT; Schema: util; Owner: -
2173
--
2174

  
2175
COMMENT ON FUNCTION keys_eq(left_ anyelement, right_ anyelement) IS '
2176
needs to be declared STABLE instead of IMMUTABLE because it depends on the search_path (as described at http://vegpath.org/links/#PostgreSQL:%20Documentation:%209.3:%20Function%20Volatility%20Categories%20**)
2177
';
2178

  
2179

  
2180
--
2181 2181
-- Name: limit2row_num(integer, integer, integer); Type: FUNCTION; Schema: util; Owner: -
2182 2182
--
2183 2183

  
......
3084 3084

  
3085 3085

  
3086 3086
--
3087
-- Name: range(numeric, numeric); Type: FUNCTION; Schema: util; Owner: -
3088
--
3089

  
3090
CREATE FUNCTION range(lower numeric, upper numeric) RETURNS numrange
3091
    LANGUAGE sql IMMUTABLE
3092
    AS $_$
3093
SELECT ('['||$1||','||$2||']')::numrange
3094
$_$;
3095

  
3096

  
3097
--
3087 3098
-- Name: recreate(text, text[]); Type: FUNCTION; Schema: util; Owner: -
3088 3099
--
3089 3100

  
......
4479 4490

  
4480 4491

  
4481 4492
--
4482
-- Name: ~(numeric, numeric); Type: FUNCTION; Schema: util; Owner: -
4483
--
4484

  
4485
CREATE FUNCTION "~"(lower numeric, upper numeric) RETURNS numrange
4486
    LANGUAGE sql IMMUTABLE
4487
    AS $_$
4488
SELECT ('['||$1||','||$2||']')::numrange
4489
$_$;
4490

  
4491

  
4492
--
4493 4493
-- Name: all_same(anyelement); Type: AGGREGATE; Schema: util; Owner: -
4494 4494
--
4495 4495

  
......
4524 4524
--
4525 4525

  
4526 4526
CREATE OPERATOR %== (
4527
    PROCEDURE = "%==",
4527
    PROCEDURE = keys_eq,
4528 4528
    LEFTARG = anyelement,
4529 4529
    RIGHTARG = anyelement
4530 4530
);
......
4622 4622
--
4623 4623

  
4624 4624
CREATE OPERATOR ~ (
4625
    PROCEDURE = "~",
4625
    PROCEDURE = range,
4626 4626
    LEFTARG = numeric,
4627 4627
    RIGHTARG = numeric
4628 4628
);

Also available in: Unified diff