Roy Badami wrote:
> Roy> The 'constraint' (interval type descriptor or whatever it's
> Roy> really called) is mandatory in standard SQL, I think, so
> Roy> there's no ambiguity anyway, unless anyone is using this
> Roy> undocumented syntax at the moment...
> Incidentally, this was the ratinale behind my earlier suggestion, that:
> * if the interval type descriptor is absent, parse the interval as a
> traditional postgres interval
> * if the interval type descriptor is present, parse the interval according
> to the standard syntax
> I have no objection to allowing things like
> '1 hour 10 minutes' DAY TO SECOND
> but I'm just wondering whether the hybrid syntax is an unnecessary
Added to TODO:
o For syntax that isn't uniquely ISO or PG syntax, like '1:30' or
'1', treat as ISO if there is a range specification clause,
and as PG if there no clause is present, e.g. interpret '1:30'
MINUTE TO SECOND as '1 minute 30 seconds', and interpret '1:30'
as '1 hour, 30 minutes'
This brings up the issue of how we are to output interval values.
Currently we do:
test=> select interval '1 hour 1 minute';
test=> select interval '1 hour 1 second' hour to minute;
so I think we are OK because we don't output ambiguous syntax.
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
In response to
pgsql-bugs by date
|Next:||From: Bruce Momjian||Date: 2005-03-24 03:49:48|
|Subject: Re: BUG #1518: Conversions to (undocumented) SQL year-month and|
|Previous:||From: Bruce Momjian||Date: 2005-03-24 02:11:46|
|Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,|