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

From Roy Badami
Subject Re: BUG #1517: SQL interval syntax is accepted by the parser,
Date
Msg-id 16962.95.458613.90797@giles.gnomon.org.uk
Whole thread Raw
In response to Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Tom> Yes.  The ISO design for the datatype is pretty brain-dead if
    Tom> you ask me --- the basic meaning of a data literal shouldn't
    Tom> be so dependent on context.

Arguably it's not, because the interval qualifier is an intrinsic (and
mandatory) part of the literal syntax, so the full ISO interval is
completely unambigous.

Where you run into problems is where you are casting strings to
intervals, in which case the way the string is parsed is (rather
unncessarily) dependent on the exact type of the interval.

This area certainly seems (over) complex, although you can see the
logic behind the design...

     -roy

pgsql-bugs by date:

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