Re: [Django] #33590: Column from view which has a left outer join invalidly becomes NULL (including coalesce) over a django cursor, but not via a direct psycopg2 cursor

5 views
Skip to first unread message

Django

unread,
Mar 21, 2022, 5:54:00 AM3/21/22
to django-...@googlegroups.com
#33590: Column from view which has a left outer join invalidly becomes NULL
(including coalesce) over a django cursor, but not via a direct psycopg2
cursor
----------------------------------+--------------------------------------
Reporter: Stefan de Konink | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: 4.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------

Comment (by Stefan de Konink):

Was able to figure out the difference in the connection setup between
psycopg2 native and Django. The latter applied {{{set time zone 'utc';}}}
when setting up the connection. That rules out that Django itself is the
problem.

{{{
blxa=> select * from myview ;
id | scheduled | exact_schedule_id |
negative_schedule_id
------------+---------------------+-------------------+----------------------
1647824400 | 2022-03-21 01:00:00 | 1 |
1
1647824400 | 2022-03-21 01:00:00 | 1 |
1
1647824400 | 2022-03-21 01:00:00 | 1 |
1
(3 rows)

blxa=> set time zone 'utc';
SET
blxa=> select * from myview ;
id | scheduled | exact_schedule_id |
negative_schedule_id
------------+---------------------+-------------------+----------------------
1647824400 | 2022-03-21 01:00:00 | 1 |
0
(1 row)
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33590#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 21, 2022, 5:54:11 AM3/21/22
to django-...@googlegroups.com
#33590: Column from view which has a left outer join invalidly becomes NULL
(including coalesce) over a django cursor, but not via a direct psycopg2
cursor
----------------------------------+--------------------------------------
Reporter: Stefan de Konink | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.0
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------
Changes (by Stefan de Konink):

* status: new => closed
* resolution: => invalid


--
Ticket URL: <https://code.djangoproject.com/ticket/33590#comment:9>

Django

unread,
Mar 21, 2022, 6:41:12 AM3/21/22
to django-...@googlegroups.com
#33590: Column from view which has a left outer join invalidly becomes NULL
(including coalesce) over a django cursor, but not via a direct psycopg2
cursor
----------------------------------+--------------------------------------
Reporter: Stefan de Konink | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: 4.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------------------------

Comment (by Stefan de Konink):

My "solution" has been to {{{select ((expanded::date + time::time) at time
zone 'Europe/Amsterdam')::timestamptz as scheduled}}} manually set the
timezone.

--
Ticket URL: <https://code.djangoproject.com/ticket/33590#comment:10>

Reply all
Reply to author
Forward
0 new messages