Re: Re: Interval output format - Mailing list pgsql-novice

From Tom Lane
Subject Re: Re: Interval output format
Date
Msg-id 6242.979870118@sss.pgh.pa.us
Whole thread Raw
In response to Re: Interval output format  ("Stefan Waidele jun." <St.Waidele.jun@Krone-Neuenburg.de>)
List pgsql-novice
"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

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: Interval output format
Next
From: Tom Lane
Date:
Subject: Re: Argh! What's a 'bpchar'? (copy/serial issues...I think)