Project

General

Profile

« Previous | Next » 

Revision 10613

schemas/util.sql: added ?*>= operator (is populated more often than) from wiki.vegpath.org/Postgres_queries#is-populated-more-often-than

View differences:

util.sql
1158 1158

  
1159 1159

  
1160 1160
--
1161
-- Name: is_populated_more_often_than(anyelement, anyelement); Type: FUNCTION; Schema: util; Owner: -
1162
--
1163

  
1164
CREATE FUNCTION is_populated_more_often_than("left" anyelement, "right" anyelement) RETURNS boolean
1165
    LANGUAGE sql IMMUTABLE
1166
    AS $_$
1167
SELECT $1 IS NOT NULL >= $2 IS NOT NULL -- true > false
1168
$_$;
1169

  
1170

  
1171
--
1161 1172
-- Name: join_strs_transform(text, text, text); Type: FUNCTION; Schema: util; Owner: -
1162 1173
--
1163 1174

  
......
1922 1933

  
1923 1934

  
1924 1935
--
1936
-- Name: ?*>=; Type: OPERATOR; Schema: util; Owner: -
1937
--
1938

  
1939
CREATE OPERATOR ?*>= (
1940
    PROCEDURE = is_populated_more_often_than,
1941
    LEFTARG = anyelement,
1942
    RIGHTARG = anyelement
1943
);
1944

  
1945

  
1946
--
1925 1947
-- Name: ?>=; Type: OPERATOR; Schema: util; Owner: -
1926 1948
--
1927 1949

  

Also available in: Unified diff