Changes between Initial Version and Version 1 of Ticket #35240


Ignore:
Timestamp:
Feb 20, 2024, 10:41:28 AM (9 months ago)
Author:
Fabi
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #35240 – Description

    initial v1  
    11Configuration 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{{{
    33In [4]: connections["default"].cursor().connection.info.timezone
    44Out[4]: zoneinfo.ZoneInfo(key='America/New_York')
    5 ```
     5}}}
    66
    77The wrapper and the psycopg3 timezone adapter both think its UTC though:
    8 ```
     8{{{
    99In [5]: connections["default"].timezone
    1010Out[5]: datetime.timezone.utc
     
    1212In [6]: connections["default"].cursor().connection.adapters.get_loader(TIMESTAMPTZ_OID, Format.TEXT).timezone
    1313Out[6]: datetime.timezone.utc
    14 ```
     14}}}
    1515
    1616Looking 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:
Back to Top