Revision 4682
Added by Aaron Marcuse-Kubitza about 12 years ago
functions.sql | ||
---|---|---|
88 | 88 |
-- |
89 | 89 |
|
90 | 90 |
CREATE FUNCTION _label(label text, value text) RETURNS text |
91 |
LANGUAGE plpgsql IMMUTABLE |
|
92 |
AS $$ |
|
93 |
DECLARE |
|
94 |
label text NOT NULL := label; -- add NOT NULL |
|
95 |
BEGIN |
|
96 |
RETURN label||': '||value; |
|
97 |
END; |
|
98 |
$$; |
|
91 |
LANGUAGE sql IMMUTABLE |
|
92 |
AS $_$ |
|
93 |
SELECT coalesce($1 || ': ', '') || $2 |
|
94 |
$_$; |
|
99 | 95 |
|
100 | 96 |
|
101 | 97 |
-- |
Also available in: Unified diff
schemas/functions.sql: _label(): Support NULL labels by not prepending a label