CREATE OR REPLACE FUNCTION nvl(expr1 text, expr2 text) RETURNS text AS $BODY$ SELECT coalesce($1, $2); $BODY$ LANGUAGE sql;