Re: problem with timezone parsing

Federico Di Gregorio <fog-NGVKUo/i/[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Organization initd.org
Message-ID <[email protected]>
Il giorno dom, 15/02/2009 alle 17.16 +0100, Karsten Hilbert ha scritto:
> On Sun, Feb 15, 2009 at 10:33:37PM +0900, James Henstridge wrote:
> 
> > > PostgreSQL (on Debian/Lenny) comes with a bunch of time
> > > zones which psycopg2 cannot parse, such as Asia/Calcutta.
> > > Attempts to read a "timestamp with time zone" column with
> > > client timezone set to one of those zones throw an "unable
> > > to parse time" exception. Strangely enough, Asia/Colombo,
> > > which has the same utc offset (05:30:00) parses just fine.
> > >
> > > The corresponding time zones can be found with the attached
> > > script (make sure to adjust the DSN).
> > >
> > > That script also reports another category of time zones
> > > which PostgreSQL includes but cannot use ;-)   But that's
> > > beyond the scope of psycopg2.
> > 
> > By any chance are the problem dates fairly old?
> 
> If "1920" is "fairly old", then, yes.
> 
> Examples are the dates of birth of some people living
> today. This is a patient database (www.gnumed.de).

I agree with you that we need a way to recover from such errors but I
don't know if raising an exception is enough. If the error generates (or
propagates) to PostgreSQL then the current transaction is aborted and
this probably something you don't want.

federico

-- 
Federico Di Gregorio                         http://people.initd.org/fog
DISCLAIMER. If I receive a message from you, you are agreeing that:
 1. I am by definition, "the intended recipient".
 2. All information in the email is mine to do with as I see fit and
 make such financial profit, political mileage, or good joke as it lends
 itself to. In particular, I may quote it on USENET or the WWW.
 3. I may take the contents as representing the views of your company.
 4. This overrides any disclaimer or statement of confidentiality that
 may be included on your message.

_______________________________________________
Psycopg mailing list
Psycopg-IAPFreCvJWPBWskQ1e/[email protected]
http://lists.initd.org/mailman/listinfo/psycopg
signature.asc (application/pgp-signature, 197 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEABECAAYFAkmZM6IACgkQvcCgrgZGjeu6oQCbBl4NeAJ4k4HHXt6rdqYnNSKt
AkYAoIPVU5BJhJUCvBg6PTrl/IoHYBPJ
=KCT1
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.