Project

General

Profile

« Previous | Next » 

Revision 4054

schemas/functions.sql: join_strs_transform(): Use STRICT optimization to avoid needing to manually check if the state value or input value is NULL (http://www.postgresql.org/docs/8.3/static/sql-createaggregate.html#AEN51596)

View differences:

schemas/functions.sql
125 125
--
126 126

  
127 127
CREATE FUNCTION join_strs_transform(state text, value text, delim text) RETURNS text
128
    LANGUAGE sql IMMUTABLE
128
    LANGUAGE sql IMMUTABLE STRICT
129 129
    AS $_$
130
SELECT (CASE
131
    WHEN $1 IS NOT NULL AND $3 IS NOT NULL
132
    THEN $1 || $3 || $2
133
    ELSE COALESCE($1, $2)
134
    END)
130
SELECT $1 || $3 || $2
135 131
$_$;
136 132

  
137 133

  

Also available in: Unified diff