"Stefan Waidele jun." <St.Waidele.jun@Krone-Neuenburg.de> writes:
> create function sum_gearbeitet(text)
> returns text
> as "select
> date_part('day',sum(gearbeitet))*24+date_part('hour',sum(gearbeitet))||':'||date_part('min',sum(gearbeitet))
> from stunden;"
> language 'sql';
That's just bogus syntax. The function body has to be surrounded by
single quotes ' not double quotes ". (Also, any single quote in the
function body has to be written as '' or \' to get past the string-
literal parser. Kind of a pain --- you might want to use something
like pgaccess to make editing easier.)
regards, tom lane