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 16961.65260.219133.672511@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,
List pgsql-bugs
Tom> It's not different from

    Tom> INSERT INTO foo VALUES('1 year 1 month');

    Tom> Nothing nonstandard about that that I can see.

Oh, does ISO allow a cast from a string to an interval?  Yes, I think
it probably does.  And with the interpretation of the string is
dependent on the ISO interval type, just like for literals?  Hmm, yes,
I think it probably does...

That convinces me that you have to figure out what to do with

    CAST ('1 year 1 month' AS INTERVAL MONTH)

It _still_ doesn't completely convince me that you need to (or even
want to) support hybrid interval syntax.

Though given you have to support both pg and ISO syntax in the cast, I
guess it becomes more consistent (and less implementation work) to
support both in the literal, too...

I'm concinced, I think.  (For the moment :)

    -roy

pgsql-bugs by date:

Previous
From: Tom Lane
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,