in our PostgreSQL config timezone was set to 'Etc/UTC' and in django was
'UTC' (There is NO difference between UTC and Etc/UTC time zones:
https://stackoverflow.com/questions/14128574/is-there-a-difference-
between-the-utc-and-etc-utc-time-zones)
which led to many unnecessary
{{{
set time zone 'UTC'
}}}
queries.
Maybe we need to change this condition to some fuzzy form? Something like
this?:
{{{
conn_timezone_name not in timezone_name and timezone_name not in
conn_timezone_name
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/34202>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Mariusz Felisiak):
> Maybe we need to change this condition to some fuzzy form? Something
like this?:
>
> {{{
> conn_timezone_name not in timezone_name and timezone_name not in
conn_timezone_name
> }}}
This would be really clunky, e.g. all `UTC+X` timezone would be consider
equal to `UTC`.
--
Ticket URL: <https://code.djangoproject.com/ticket/34202#comment:1>
* status: new => closed
* type: Bug => Cleanup/optimization
* resolution: => wontfix
Comment:
Maintaining list of time zone aliases in Django is not doable. Also, `UTC`
and `Etc/UTC` are not considered equal by `zoneinfo`:
{{{
>>> import zoneinfo
>>> z1 = zoneinfo.ZoneInfo("UTC")
>>> z2 = zoneinfo.ZoneInfo("Etc/UTC")
>>> z1 == z2
False
}}}
so I don't think there is much we can do in Django itself. I'd recommend
to use `UTC` in PostgreSQL or `Etc/UTC` in `settings.TIME_ZONE`.
--
Ticket URL: <https://code.djangoproject.com/ticket/34202#comment:2>