Revision 12222
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/schemas/util.sql | ||
---|---|---|
1380 | 1380 |
CREATE FUNCTION ifnull(value anyelement, null_ anyelement) RETURNS anyelement |
1381 | 1381 |
LANGUAGE sql IMMUTABLE |
1382 | 1382 |
AS $_$ |
1383 |
SELECT (CASE WHEN $1 IS NULL THEN $2 ELSE $1 END)
|
|
1383 |
SELECT COALESCE($1, $2)
|
|
1384 | 1384 |
$_$; |
1385 | 1385 |
|
1386 | 1386 |
|
Also available in: Unified diff
schemas/util.sql: ifnull(): use COALESCE instead, because it turns out that MySQL's IFNULL is just a special case of this