[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnumed-devel] Waiting time display question
From: |
Karsten Hilbert |
Subject: |
Re: [Gnumed-devel] Waiting time display question |
Date: |
Mon, 25 Jun 2012 09:46:56 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Jun 25, 2012 at 04:55:35AM +0000, Jim Busser wrote:
> I am seeing values that I do not understand displayed in Waiting list plug in.
The waiting list view uses this:
(SELECT to_char(age(now(), wl.registered), 'TMDD HH24:MI'::text) AS
to_char)
AS waiting_time_formatted
SQL code. I guess don't ask me what I expected to happen
here if we consider the documentation:
http://www.postgresql.org/docs/9.1/static/functions-formatting.html#FUNCTIONS-FORMATTING-DATETIME-TABLE
:-)
This test shows more:
gnumed_v18=> SELECT to_char('11y 5months 6d'::interval, 'TMDD HH24:MI');
to_char
----------
06 00:00
Apparently I chose to ignore parts of the waiting time which
go beyond the number of days specified (likely because I did
not envision your use case and expecting only a few days at
most).
Further experimentation shows that this
gnumed_v18=> SELECT to_char('11y 5months 6d'::interval, 'TMDDD
HH24:MI');
to_char
------------
4116 00:00
is what was likely desired. So we are lacking one D in the
specifier (apart from the excessive TM).
You found a bug in the database definition ! :-)
Fixing ...
The attached file can be applied to either a v16 or a v17
database in order to fix this issue.
Karsten
--
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
v16-clin-waiting_list-dynamic.sql
Description: application/sql