#37137: Replace raw SQL suggestion in TIME_ZONE docs
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Type:
| Cleanup/optimization
Status: new | Component:
| Documentation
Version: dev | Severity: Normal
Keywords: postgresql, | Triage Stage:
timezone | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Our docs counsel avoiding raw SQL usage where the ORM can do. We have old
advice in the `TIME_ZONE` setting advising to use "raw SQL" when local
time conversions are needed. I think instead we should suggest using a
lightweight `Func` wrapping [https://www.postgresql.org/docs/current
/functions-datetime.html#FUNCTIONS-DATETIME-
ZONECONVERT:~:text=The%20function-,timezone,-(zone%2C%20timestamp
timezone()] to accomplish the same thing:
[https://docs.djangoproject.com/en/dev/ref/settings/#:~:text=raw%20SQL
Current text]:
{{{
Consider converting to local time explicitly with ``AT TIME ZONE`` in
raw SQL
queries instead of setting the ``TIME_ZONE`` option.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/37137>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/django-updates/0107019e8a07e8c4-5593a5ef-9df5-41e8-a617-2e936768c71a-000000%40eu-central-1.amazonses.com.