Revision 12436
Added by Aaron Marcuse-Kubitza almost 11 years ago
util.sql | ||
---|---|---|
78 | 78 |
CREATE FUNCTION "%=="(left_ anyelement, right_ anyelement) RETURNS boolean |
79 | 79 |
LANGUAGE sql IMMUTABLE |
80 | 80 |
AS $_$ |
81 |
SELECT $1 = $2
|
|
81 |
SELECT keys($1) = keys($2)
|
|
82 | 82 |
$_$; |
83 | 83 |
|
84 | 84 |
|
... | ... | |
1751 | 1751 |
|
1752 | 1752 |
|
1753 | 1753 |
-- |
1754 |
-- Name: keys(anyelement); Type: FUNCTION; Schema: util; Owner: - |
|
1755 |
-- |
|
1756 |
|
|
1757 |
CREATE FUNCTION keys(value anyelement) RETURNS anyelement |
|
1758 |
LANGUAGE sql IMMUTABLE |
|
1759 |
AS $_$ |
|
1760 |
SELECT $1 -- compare on the entire value |
|
1761 |
$_$; |
|
1762 |
|
|
1763 |
|
|
1764 |
-- |
|
1754 | 1765 |
-- Name: limit2row_num(integer, integer, integer); Type: FUNCTION; Schema: util; Owner: - |
1755 | 1766 |
-- |
1756 | 1767 |
|
Also available in: Unified diff
schemas/util.sql: %== : use custom keys() function for the type, so that the user only has to get the keys from their value, not also write the comparison of those keys