#17266: psycopg2 backend should use get_parameter_status to check if SET TIME ZONE is needed -------------------------------------+------------------------------------- Reporter: akaariai | Owner: nobody Type: | Status: new Cleanup/optimization | Version: Component: Database layer | Resolution: (models, ORM) | Triage Stage: Accepted Severity: Normal | Needs documentation: 0 Keywords: | Patch needs improvement: 0 Has patch: 1 | UI/UX: 0 Needs tests: 0 | Easy pickings: 0 | -------------------------------------+-------------------------------------
Comment (by akaariai): I have tested this on psycopg 2.0.1, which does not work at all with Django (unrelated to this ticket - expects port as an integer), psycopg2 2.0.7 - works, psycopg2 2.0.11 - works, psycopg 2.3.2 works and finally the current psycopg 2.4.2 - works. Results in above post are with 2.4.2. In no case did the patch result in worse behavior. If get_parameter_status is not available, the patch doesn't change anything for new connections. If it is available, and time zone is correct for the connection, you can get rid of 3 non-necessary queries. My opinion is that the patch is ready for committer. A summary for reviewer / committer: - Please review the documentation changes with extra care. Writing documentation is not my strongest area... - The patch will get rid of all non-necessary queries for new connections when settings for the connection are correct (in postgresql.conf or for the user). The documentation mentions the necessary changes to connection settings. - The patch should work with all supported psycopg2 versions. - There are no tests, as there is no easy way to test what queries psycopg2 has actually executed. See above post for how to test this manually. -- Ticket URL: <https://code.djangoproject.com/ticket/17266#comment:3> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.