Project

General

Profile

« Previous | Next » 

Revision 4682

schemas/functions.sql: _label(): Support NULL labels by not prepending a label

View differences:

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