Re: INTERVAL representation

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: INTERVAL representation
Дата
Msg-id 20001106102354.A30863@rice.edu
обсуждение исходный текст
Ответ на INTERVAL representation  (Thomas Lockhart <lockhart@alumni.caltech.edu>)
Список pgsql-hackers
On Fri, Nov 03, 2000 at 04:25:23PM +0000, Thomas Lockhart wrote:
> I've been working on date/time issues over the last few weeks (at least
> one or two from reports on the list, others that I've stumbled across,
> and even one or two planned ones ;)
> 
<snip>
> 
> Should we move to signed-only representations? Or retain the "ago"
> convention, having it match the sign of the first printed field, with
> subsequent fields having negative signs if they are positive values?
> 
> At the moment, mixed-sign intervals are stored correctly (so have the
> right results for math) but are *not* represented in the output
> correctly.
> 
> Possibilities are:
> 
> '1 month -2 days ago' is less than a month ago.
> '1 month -2 days +03:04' is three hours more than two days less than a
> month from now.
> '-1 month +2 days' is less than a month ago.
> 
> Comments?
> 

Hmm, negative time values always force me to think twice. I guess I think of
time as a concrete thing, like a board: it has length, at to speak of a 
negative length' makes little sense. Admittedly, time is inherently vectorial,
which other physical length measurements are not, requiring an arbitrarily
chosen point as reference.

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.

Ross
-- 
Open source code is like a natural resource, it's the result of providing
food and sunshine to programmers, and then staying out of their way.
[...] [It] is not going away because it has utility for both the developers 
and users independent of economic motivations.  Jim Flynn, Sunnyvale, Calif.


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Martin A. Marques"
Дата:
Сообщение: Re: problems with configure
Следующее
От: Tom Lane
Дата:
Сообщение: Re: problems with configure