Project

General

Profile

« Previous | Next » 

Revision 2595

schemas/functions.sql: Added join_strs() aggregate

View differences:

schemas/functions.sql
85 85

  
86 86

  
87 87
--
88
-- Name: join_strs_(text, text, text); Type: FUNCTION; Schema: functions; Owner: -
89
--
90

  
91
CREATE FUNCTION join_strs_(state text, delim text, value text) RETURNS text
92
    LANGUAGE sql IMMUTABLE
93
    AS $_$
94
SELECT $1 || (CASE
95
WHEN $1 = '' OR $3 IS NULL OR $3 = ''
96
THEN ''
97
ELSE $2
98
END) || coalesce($3, '');
99
$_$;
100

  
101

  
102
--
88 103
-- Name: timestamp with time zone(text); Type: FUNCTION; Schema: functions; Owner: -
89 104
--
90 105

  
......
104 119
$$;
105 120

  
106 121

  
122
--
123
-- Name: join_strs(text, text); Type: AGGREGATE; Schema: functions; Owner: -
124
--
125

  
126
CREATE AGGREGATE join_strs(text, text) (
127
    SFUNC = join_strs_,
128
    STYPE = text,
129
    INITCOND = ''
130
);
131

  
132

  
107 133
SET default_tablespace = '';
108 134

  
109 135
SET default_with_oids = false;

Also available in: Unified diff