Re: problem with timezone parsing
James Henstridge <[email protected]>
| Newsgroups | gmane.comp.python.db.psycopg.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Feb 17, 2009 at 8:04 PM, Karsten Hilbert <[email protected]> wrote: >> As mentioned before, if you want behaviour different to this I'd >> suggest installing an alternative typecaster. That would also let you >> fix the busted time zone parsing for released versions of psycopg2. > > Is there a way to install a custom typecaster, then from > inside which letting the default typecaster handle things > but listen for the above exception and handle that > appropriately ? You can call the other typecaster directly: timestamp = psycopg2.DATETIME(some_string, cursor) Your typecast function will be passed the string and cursor as arguments. James.