Changes between Version 3 and Version 4 of Ticket #32690, comment 3
- Timestamp:
- Apr 28, 2021, 7:33:27 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32690, comment 3
v3 v4 5 5 Yes. Let me know if there is anything else that I can help with in the reproduction. 6 6 7 edit: added the attachment 8 9 edit2: 10 11 Inside of the ticket32690.django.proj.tar.gz readme.md, also my bad, the RealmAccess field for "property_group" should have been renamed, and migrated: 7 Inside of the ticket32690.django.proj.tar.gz readme.md: 12 8 13 9 … … 32 28 From inside the django shell 33 29 34 ``` example35 07: 11:24(.env) jmunsch@pop-os ticket32690 → ./manage.py shell30 ``` 31 07:30:35 (.env) jmunsch@pop-os ticket32690 → ./manage.py shell 36 32 Python 3.8.9 (default, Apr 14 2021, 18:54:59) 37 33 [GCC 9.3.0] on linux … … 58 54 "things_thing"."actor_id", 59 55 "things_thing"."realms", 60 COUNT("things_actorrealmaccess"." property_group_id") AS "actor__realm_access__count"56 COUNT("things_actorrealmaccess"."realm_access_id") AS "actor__realm_access__count" 61 57 FROM "things_thing" 62 58 INNER JOIN "things_actor" ON ("things_thing"."actor_id" = "things_actor"."id") … … 64 60 LEFT OUTER JOIN "things_actorrealmaccess" T5 ON ("things_actor"."id" = T5."actor_id") 65 61 GROUP BY "things_thing"."id", 66 T5." property_group_id",62 T5."realm_access_id", 67 63 (SELECT U0."id", 68 64 U0."created", … … 72 68 U0."name" 73 69 FROM "things_realmaccess" U0 74 INNER JOIN "things_actorrealmaccess" U1 ON (U0."id" = U1." property_group_id")70 INNER JOIN "things_actorrealmaccess" U1 ON (U0."id" = U1."realm_access_id") 75 71 WHERE U1."actor_id" = 2) 76 HAVING (T5." property_group_id" IN72 HAVING (T5."realm_access_id" IN 77 73 (SELECT U0."id" 78 74 FROM "things_realmaccess" U0 79 INNER JOIN "things_actorrealmaccess" U1 ON (U0."id" = U1." property_group_id")75 INNER JOIN "things_actorrealmaccess" U1 ON (U0."id" = U1."realm_access_id") 80 76 WHERE U1."actor_id" = 2) 81 OR COUNT("things_actorrealmaccess"." property_group_id") = 0)77 OR COUNT("things_actorrealmaccess"."realm_access_id") = 0) 82 78 Traceback (most recent call last): 83 79 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute 84 80 return self.cursor.execute(sql, params) 85 81 psycopg2.errors.SyntaxError: subquery must return only one column 86 LINE 1: ... P BY "things_thing"."id", T5."property_group_id", (SELECT U0...82 LINE 1: ...OUP BY "things_thing"."id", T5."realm_access_id", (SELECT U0... 87 83 ^ 84 85 86 The above exception was the direct cause of the following exception: 87 88 Traceback (most recent call last): 89 File "<console>", line 1, in <module> 90 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/models/query.py", line 256, in __repr__ 91 data = list(self[:REPR_OUTPUT_SIZE + 1]) 92 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/models/query.py", line 262, in __len__ 93 self._fetch_all() 94 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/models/query.py", line 1324, in _fetch_all 95 self._result_cache = list(self._iterable_class(self)) 96 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/models/query.py", line 51, in __iter__ 97 results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) 98 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/models/sql/compiler.py", line 1169, in execute_sql 99 cursor.execute(sql, params) 100 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/backends/utils.py", line 98, in execute 101 return super().execute(sql, params) 102 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/backends/utils.py", line 66, in execute 103 return self._execute_with_wrappers(sql, params, many=False, executor=self._execute) 104 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers 105 return executor(sql, params, many, context) 106 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute 107 return self.cursor.execute(sql, params) 108 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/utils.py", line 90, in __exit__ 109 raise dj_exc_value.with_traceback(traceback) from exc_value 110 File "/home/jmunsch/PycharmProjects/test-django/.env/lib/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute 111 return self.cursor.execute(sql, params) 112 django.db.utils.ProgrammingError: subquery must return only one column 113 LINE 1: ...OUP BY "things_thing"."id", T5."realm_access_id", (SELECT U0... 114 ^ 115 116 >>> 117 88 118 ``` 119 89 120 }}} 90 121