All pastes #916271 Raw Edit

Untitled

public text v1 · immutable
#916271 ·published 2008-02-24 14:08 UTC
rendered paste body
shesek=> CREATE FUNCTION comma_aggregate(character varying, character varying) RETURNS character varying AS $_$
shesek$>  begin
shesek$>    if length($1)>0 and length($2)>0 then
shesek$>        return $1 || ', ' || $2;
shesek$>    elsif length($2)>0 then
shesek$>      return $2;
shesek$>    end if;
shesek$>    return $1;
shesek$>  end;
shesek$>  $_$
shesek-> LANGUAGE plpgsql;
ERROR:  syntax error at or near " begin" at character 104
LINE 2:  begin
        ^
shesek=>