Consistency problem with unlabeled intervals

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Consistency problem with unlabeled intervals
Date: 2002-05-02 21:35:01
Message-ID: 18363.1020375301@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In current sources:

regression=# select '60'::interval;
interval
----------
00:01
(1 row)

regression=# select '1.5'::interval;
interval
-------------
00:00:01.50
(1 row)

That is, '60' is read as so many hours, '1.5' is read as so many
seconds. This seems a tad inconsistent.

7.2 does the same thing, 7.1 says
ERROR: Bad interval external representation '60'
but takes '1.5' as meaning 1.5 seconds.

I'd prefer to standardize on a unit of seconds myself.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jason Earl 2002-05-02 22:01:56 Re: PostgreSQL mission statement?
Previous Message Tom Lane 2002-05-02 21:16:38 Re: Per tuple overhead, cmin, cmax