Re: Re: Interval output format

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Stefan Waidele jun(dot)" <St(dot)Waidele(dot)jun(at)Krone-Neuenburg(dot)de>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Re: Interval output format
Date: 2001-01-19 02:08:38
Message-ID: 6242.979870118@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Stefan Waidele jun." <St(dot)Waidele(dot)jun(at)Krone-Neuenburg(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2001-01-19 02:27:08 Re: Argh! What's a 'bpchar'? (copy/serial issues...I think)
Previous Message Tom Lane 2001-01-19 02:06:00 Re: Re: Interval output format