Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle
Date
Msg-id 19477.1225814409@sss.pgh.pa.us
Whole thread Raw
In response to Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Responses Re: Patch for SQL-Standard Interval output and decoupling DateStyle from IntervalStyle  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
List pgsql-hackers
Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
> Ah.  And one final question regarding functionality.
> It seems to me that the last remaining place where we input
> a SQL-2008 standard literal and do something different from
> what the standard suggests is with the string:
>    '-1 2:03:04'
> The standard seems to say that the "-" affects both the
> days and hour/min/sec part; while PostgreSQL historically,
> and the patch as I first submitted it only apply the negative
> sign to the days part.

> IMHO when the IntervalStyle GUC is set to "sql_standard",
> it'd be better if the parsing of this literal matched the
> standard.

Then how would you input a value that had different signs for the
day and the h/m/s?  I don't think "you can't" is an acceptable
answer there, because it would mean that interval_out has to fail
on such values when IntervalStyle is "sql_standard".  Which is
very clearly not gonna do.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Patch for SQL-Standard Interval output and decouplingDateStyle from IntervalStyle
Next
From: "Robert Haas"
Date:
Subject: Re: [WIP] In-place upgrade