Re: psycopg2: parsing timestamps with odd time zones

Daniele Varrazzo <[email protected]> Thu, 20 May 2010 02:39:02 +0100
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Wed, May 19, 2010 at 9:06 PM, Federico Di Gregorio <fog-NGVKUo/i/[email protected]> wrote:

> I never investigated this issue very much, just accepted the patches.
> Sincerely I'd better like to introduce a trascurable error (< 1m),
> document it and send TSTZ_W_SECS to the grave. For all practical
> purpouses it is a negligible error and if a user NEEDS such precision
> she can write her own typecaster.

I've fixed the default typecaster to round to the nearest minute, plus
tests and docs (the relevant section can be read at
http://initd.org/psycopg/docs/usage.html#time-zones-handling). I've
also changed register_tstz_w_secs() to be no-op, because now the
default typecaster does better (the error is up to 30 sec, it used to
be up to 59 sec).

-- Daniele