Changes between Initial Version and Version 1 of Ticket #35240
- Timestamp:
- Feb 20, 2024, 10:41:28 AM (9 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35240 – Description
initial v1 1 1 Configuration uses `USE_TZ=True` and database defaults to `America/New_York`. I would expect the connection then being set to UTC, but it is not changed: 2 ``` 2 {{{ 3 3 In [4]: connections["default"].cursor().connection.info.timezone 4 4 Out[4]: zoneinfo.ZoneInfo(key='America/New_York') 5 ``` 5 }}} 6 6 7 7 The wrapper and the psycopg3 timezone adapter both think its UTC though: 8 ``` 8 {{{ 9 9 In [5]: connections["default"].timezone 10 10 Out[5]: datetime.timezone.utc … … 12 12 In [6]: connections["default"].cursor().connection.adapters.get_loader(TIMESTAMPTZ_OID, Format.TEXT).timezone 13 13 Out[6]: datetime.timezone.utc 14 ``` 14 }}} 15 15 16 16 Looking at the code I think the problem is that the adapter gets initialized with `self.timezone` which then gets compared with `self.timezone` later again, resulting in a no-op: