Re: BUG #1517: SQL interval syntax is accepted by the parser, - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1517: SQL interval syntax is accepted by the parser,
Date
Msg-id 14947.1111616675@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Roy Badami <roy@gnomon.org.uk>)
Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Roy Badami <roy@gnomon.org.uk>)
List pgsql-bugs
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>         o Interpret syntax that isn't uniquely ANSI or PG, like '1:30' or
>           '1' as ANSI syntax, e.g. interpret '1:30' MINUTE TO SECOND as
>           '1 minute 30 seconds'

> This is going to be a backward compatibility problem, but to support
> ANSI syntax we are going to need to do this.

We should do that *only* when an ISO (not ANSI) interval constraint is
present.  So plain INTERVAL '1' would still be read under PG rules.
That would eliminate the backward-compatibility problem pretty well
(since the constraints aren't documented and hence aren't being used
now), while not posing a big problem for ISO cases (since if there's
no constraint there are no ambiguous cases, I believe --- the ISO
syntax would require all fields to be present).

            regards, tom lane

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Next
From: Roy Badami
Date:
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,