Re: fomatting an interval

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joseph Shraibman <joseph(at)xtenit(dot)com>
Cc: nolan(at)celery(dot)tssi(dot)com, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: fomatting an interval
Date: 2003-05-13 03:49:23
Message-ID: 1998.1052797763@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joseph Shraibman <joseph(at)xtenit(dot)com> writes:
> playpen=# select start, finish, (finish-start),(finish-start)::interval(0) from timetable;
> start | finish | ?column? | interval
> -------------------------+-------------------------+--------------+--------------
> 2003-05-12 21:37:44.933 | 2003-05-12 21:39:14.752 | 00:01:29.819 | 00:01:29.819
> (1 row)

[ blinks... ] It works for me in CVS tip ... [ time passes... ]
You're right though, it's busted in 7.3.*, and this was the fix:

2003-01-08 19:58 tgl

* src/include/catalog/pg_proc.h: Add missing pg_proc entry for
interval_scale(). The lack of this entry causes interval rounding
not to work as expected in 7.3, for example SELECT
'18:17:15.6'::interval(0) does not round the value. I did not
force initdb, but one is needed to install the added row.

We could backpatch this into the 7.3 branch, but it would only help
people who recompiled *and* re-initdb'd from the 7.3.3 sources. I
thought at the time it'd just create confusion to do that. I'm willing
to listen to other opinions though ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2003-05-13 04:29:22 Re: fomatting an interval
Previous Message HongWT 2003-05-13 03:38:20 how to check if a table is being locked or not?