Tom Lane wrote:
"Stephen R. van den Berg" <[EMAIL PROTECTED]> writes:
Intervals are a scalar, not an addition of assorted values, alternating signs
between fields would be wrong.

Sorry, you're the one who's wrong on that.  We've treated intervals as
three independent fields for years now (and before that it was two
independent fields).  We're not going to throw away that capability.

+1 It's very useful.

Currently our terse input format that's similar to the SQL standard
rejects more mixed-sign intervals than I'd like.  I'd be quite
happy if:
  '1 2:03:-04'
gave me
  '1 day 2 hours 3 minutes -4 seconds'
but currently we reject that mixed-sign-literal.


I'd just like to find a way to have SQL-standard input produce SQL-standard
output in the cases where the input happened to match the standard.

If we had a blank slate, my vote would be that
  '-1 2:03:04'  should mean what the SQL standard says it should.
  '-1 +2:03:04' should mean negative 1 days, plus 2 hours 3 minutes 4 sec
  '1 2:03:-04'  should mean 1 day 2 hours 3 minutes minus 4 seconds
  '-1 2:03:+04'  should mean negative 1 day 2 hours 3 minutes plus 4 seconds
but I'm aware that there are backward compatibility issues.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to