Re: INTERVAL representation - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: INTERVAL representation
Date
Msg-id 3A081589.BD1A3108@alumni.caltech.edu
Whole thread Raw
In response to INTERVAL representation  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
List pgsql-hackers
> Hmm, I started this reply planning on arguing that _keeping_ the 'ago'
> was easiest on my ears. Now I find I've talked myself into losing it,
> because it implies too much: 'ago' claims that that one end of the
> interval is 'now' and the other end is in the past. If what you've got
> is actually the difference between next Christmas and New Years:
> template1=# select ('25/12/2000'::timestamp - '01/01/2001'::timestamp)
>            as "deadtime";
>   deadtime
> -------------
>  7 00:00 ago
> (1 row)
> That seems just wrong.

I've removed the "ago convention" from the ISO interval format, but have
retained it for the "traditional Postgres" format. In the latter case,
the first numeric field is never negative, and the "ago", if present,
indicates a negative interval. Subsequent fields can have a positive or
negative sign, and if negative will indicate a sign flip relative to the
leading "ago-qualified" field.

The input interpretation of all of this is about the same as for 7.0.2,
though we now do a better job coping with more variations on the
"hh:mm:ss" style of representation.

Take a look at it and let me know what y'all think!
                   - Thomas


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Horology regress test changed?
Next
From: Hannu Krosing
Date:
Subject: Re: Transaction ID wraparound: problem and proposed solution