gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnumed-devel] bug in interval2DateTimeDelta() method of TypeCast


From: Karsten Hilbert
Subject: [Gnumed-devel] bug in interval2DateTimeDelta() method of TypeCast
Date: Wed, 12 May 2004 13:15:47 +0200
User-agent: Mutt/1.3.22.1i

Dear pyPgSQL developers,

pyPgSQL assumes that PostgreSQL will not issue "mons" parts in
interval output. It does, however, if age() is used in
queries. The result of age() is, of course, not safe for
post-processing and thus shouldn't really be used. However,
pyPgSQL also works around the unsafe practice of returning
"years" parts in intervals (yes, they are 365.2425 days in
most cases but not always, think leap years).

So, to at least make pyPgSQL *work* with intervals including
"mons" I fixed interval2DateTimeDelta(). Patch attached. I
also added a comment explaining why date-date should be used
instead of age() if one intends to post-process the interval.

Please consider for inclusion.

Regards,
Karsten Hilbert, MD
GnuMed i18n coordinator
-- 
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346

Attachment: ZZ-pyPgSQL-interval2mxDateTimeDelta-bugfix.py
Description: Text document

Attachment: pgpiwkdElYG4l.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]