Revision 5937
Added by Aaron Marcuse-Kubitza over 12 years ago
functions.sql | ||
---|---|---|
47 | 47 |
|
48 | 48 |
|
49 | 49 |
-- |
50 |
-- Name: _and(boolean, boolean); Type: FUNCTION; Schema: functions; Owner: - |
|
51 |
-- |
|
52 |
|
|
53 |
CREATE FUNCTION _and("0" boolean DEFAULT NULL::boolean, "1" boolean DEFAULT NULL::boolean) RETURNS boolean |
|
54 |
LANGUAGE sql IMMUTABLE |
|
55 |
AS $_$ |
|
56 |
SELECT bool_and(value) |
|
57 |
FROM |
|
58 |
(VALUES |
|
59 |
($1) |
|
60 |
, ($2) |
|
61 |
) |
|
62 |
AS v (value) |
|
63 |
$_$; |
|
64 |
|
|
65 |
|
|
66 |
-- |
|
67 |
-- Name: FUNCTION _and("0" boolean, "1" boolean); Type: COMMENT; Schema: functions; Owner: - |
|
68 |
-- |
|
69 |
|
|
70 |
COMMENT ON FUNCTION _and("0" boolean, "1" boolean) IS 'NULL values are ignored rather than propagated.'; |
|
71 |
|
|
72 |
|
|
73 |
-- |
|
74 |
-- Name: _and(boolean, boolean, boolean, boolean, boolean); Type: FUNCTION; Schema: functions; Owner: - |
|
75 |
-- |
|
76 |
|
|
77 |
CREATE FUNCTION _and("0" boolean DEFAULT NULL::boolean, "1" boolean DEFAULT NULL::boolean, "2" boolean DEFAULT NULL::boolean, "3" boolean DEFAULT NULL::boolean, "4" boolean DEFAULT NULL::boolean) RETURNS boolean |
|
78 |
LANGUAGE sql IMMUTABLE |
|
79 |
AS $_$ |
|
80 |
SELECT bool_and(value) |
|
81 |
FROM |
|
82 |
(VALUES |
|
83 |
($1) |
|
84 |
, ($2) |
|
85 |
, ($3) |
|
86 |
, ($4) |
|
87 |
, ($5) |
|
88 |
) |
|
89 |
AS v (value) |
|
90 |
$_$; |
|
91 |
|
|
92 |
|
|
93 |
-- |
|
50 | 94 |
-- Name: _eq(anyelement, anyelement); Type: FUNCTION; Schema: functions; Owner: - |
51 | 95 |
-- |
52 | 96 |
|
Also available in: Unified diff
schemas/functions.sql: Added _and()