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 16956.22889.962007.979933@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>)
Re: BUG #1517: SQL interval syntax is accepted by the parser,  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-bugs
Tom> Feel like hacking the code?

Hmm, in principle I might take a look some time; in reality it's
unlikely I'll have time any time soon...

There are some design issues involved, though.  If you have the type
modifier, do you isnist on SQL syntax in the string?

ie do you accept

   interval '1 day 1 hour' day to second

Personally I think it would be a bad idea to allow hybrid SQL/postgres
syntax like this.

IMHO, you should either write

   interval '1 day 1 hour'

(postgres style), or

   interval '1 1:00:00' day to second

(SQL style.)

Hmm, except writing the above has just raised another question.  Is
that what the postgres-ism really means (I think it does) or does it
mean

   interval '1 1' day to hour

Once you start distinguishing your interval types, does this become
important?  Actually, I can't immediately see a case where it would
matter, but that doesn't mean there isn't one...

    -roy

pgsql-bugs by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: BUG #1518: Conversions to (undocumented) SQL year-month
Next
From: Tom Lane
Date:
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,