Re: BUG #1517: SQL interval syntax is accepted by the parser,

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Roy Badami <roy(at)gnomon(dot)org(dot)uk>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1517: SQL interval syntax is accepted by the parser,
Date: 2005-03-23 23:49:54
Message-ID: 15836.1111621794@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Roy Badami <roy(at)gnomon(dot)org(dot)uk> writes:
> 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...

Right. It's the same underlying routines; it would actually be pretty
hard to make the above cast behave differently from input into a column
of INTERVAL MONTH type, or from the interval-literal case. In all these
cases we are taking a string and cramming it into the input conversion
function for the INTERVAL datatype. The conversion function has access
to the typmod (ie the encoded <interval qualifier>) but it doesn't know
much more about the context than that.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2005-03-23 23:55:04 Re: BUG #1517: SQL interval syntax is accepted by the parser,
Previous Message Roy Badami 2005-03-23 23:48:47 Re: BUG #1517: SQL interval syntax is accepted by the parser,