-
-
Notifications
You must be signed in to change notification settings - Fork 529
Closed
Description
Starting with:
338dbe70a6c78c7edddea985e2386ebd864378c6 is the first bad commit
commit 338dbe70a6c78c7edddea985e2386ebd864378c6
Author: Daniele Varrazzo <daniele.varrazzo@gmail.com>
Date: Thu Jun 15 18:24:25 2017 +0100
Dropped wrong associations of PG types to datetime object
The wrong associations are overwritten in the typecaster map by the
right ones, so they have been harmless to date, but only because of the
order of creation of the adapters.
:040000 040000 c23e215e83527f2986e8eff25be04f494bf78403 237707ef6d9f1aa3ef4e3c718ea5a6c9d88aa748 M psycopg
the following code:
import psycopg2, pytz, datetime
conn = psycopg2.connect('dbname=florian')
c = conn.cursor()
c.execute('CREATE TABLE IF NOT EXISTS array_test (datetimes timestamp with time zone[])')
c.execute('TRUNCATE array_test')
d = datetime.datetime.now().replace(tzinfo=pytz.utc)
c.execute('INSERT INTO array_test VALUES (%s)', [[d]])
c.execute('SELECT * FROM array_test')
print c.fetchall()
results in:
[('{"2017-07-23 12:40:22.139347+02"}',)]
and previously returned something along the lines of:
[([datetime.datetime(2017, 7, 23, 12, 38, 4, 777967, tzinfo=psycopg2.tz.FixedOffsetTimezone(offset=120, name=None))],)]
This currently causes Django testsuite to fail. Is this something we have to work around, or an error in psycopg? Please tell me if you need an more details.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels