From: Joerg Jaspert Date: Tue, 22 Apr 2008 19:23:02 +0000 (+0200) Subject: Added an sql function X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97a63de415ffaf460487028de93c8566c1f7d897;p=dak Added an sql function --- diff --git a/ChangeLog b/ChangeLog index 28c5aada..cfbeffb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-04-22 Joerg Jaspert + * setup/init_pool.sql: added a function/aggregate for the release + team to base some script on it. + * config/debian/cron.daily: push katie@merkel to immediately start the sync of projectb there. diff --git a/setup/init_pool.sql b/setup/init_pool.sql index 8797acd5..0ab91ad6 100644 --- a/setup/init_pool.sql +++ b/setup/init_pool.sql @@ -184,3 +184,19 @@ CREATE INDEX binaries_maintainer ON binaries (maintainer); CREATE INDEX binaries_fingerprint on binaries (sig_fpr); CREATE INDEX source_fingerprint on source (sig_fpr); CREATE INDEX dsc_files_file ON dsc_files (file); + +-- Own function +CREATE FUNCTION space_concat(text, text) RETURNS text + AS $_$select case +WHEN $2 is null or $2 = '' THEN $1 +WHEN $1 is null or $1 = '' THEN $2 +ELSE $1 || ' ' || $2 +END$_$ + LANGUAGE sql; + +CREATE AGGREGATE space_separated_list ( + BASETYPE = text, + SFUNC = space_concat, + STYPE = text, + INITCOND = '' +);