Roy Badami <roy@gnomon.org.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