Using postgres, if you rollback the first transaction on a connection, the effect of settings.TIME_ZONE is lost
|Reported by:||mwhudson||Owned by:||aaugustin|
|Component:||Database layer (models, ORM)||Version:||1.3|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The fix for #3459 means that SET TIME ZONE is only called once per connection. But as per http://www.postgresql.org/docs/8.3/static/sql-set.html:
If SET (or equivalently SET SESSION) is issued within a transaction that is later aborted, the effects of the SET command disappear when the transaction is rolled back.
So if you're unlucky enough for the first transaction on a connect to get rolled back, the effect of settings.TIME_ZONE is lost for the life time of that connection -- which could quite possibly be lifetime of the process.
A simple fix would be to always COMMIT after setting the timezone -- I don't know if that would cause other problems though.
Change History (17)
comment:1 Changed 4 years ago by mwhudson
- Cc mwhudson added
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
Changed 4 years ago by akaariai
comment:12 Changed 4 years ago by aaugustin
- Resolution set to fixed
- Status changed from new to closed