Re: intervals in 7.3.1

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jukka Väänänen <jukka(dot)vaananen(at)batman(dot)jypoly(dot)fi>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: intervals in 7.3.1
Date: 2003-01-20 15:38:25
Message-ID: 3211.1043077105@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?ISO-8859-1?Q?Jukka_V=E4=E4n=E4nen?= <jukka(dot)vaananen(at)batman(dot)jypoly(dot)fi> writes:
> I have been using intervals in postgresql like this:
> select interval('2 weeks');
> We upgraded to 7.3.1 and now this produces error:
> ERROR: parser: parse error at or near "'2 weeks'" at character 17

Yup. "INTERVAL(n)" is now a type name, per SQL spec, and there doesn't
seem to be any way to persuade the parser that it could be a function
call as well. You could double-quote the name:
select "interval"('2 weeks');
but it's probably better to migrate to the cast syntax.

timestamp() has the same problem btw ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-01-20 15:39:13 Re: Altering a table - positioning new columns
Previous Message Tom Lane 2003-01-20 15:33:30 Re: Database Performance problem