Re: Re: FWD: tinterval vs interval on pgsql-novice - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Re: FWD: tinterval vs interval on pgsql-novice
Date
Msg-id Pine.LNX.4.21.0011281813330.1014-100000@peter.localdomain
Whole thread Raw
In response to Re: FWD: tinterval vs interval on pgsql-novice  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane writes:

> template1=# select ('today', interval '1 day') OVERLAPS ('yesterday', interval
> '18 hours');
> ERROR:  parser: parse error at or near "overlaps"
> 
> I don't understand why we're getting a parse error here ...

The OVERLAPS special SQL-construct is converted into the 'select
overlaps(...)' function call, which isn't allowed because OVERLAPS is a
keyword.  *That* is where the parse error is coming from.

To fix this you simply need to double-quote "overlaps" when it's used as a
straight function call.  See how substring does it in pg_proc.h.

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/



pgsql-hackers by date:

Previous
From: "Mitch Vincent"
Date:
Subject: Re: beta testing version
Next
From: Zeugswetter Andreas SB
Date:
Subject: AW: Please advise features in 7.1 (SUMMARY)