Skip to content

Commit 7cc382e

Browse files
committed
Fix query for older versions of PostgreSQL
PostgreSQL 15 and earlier require an explicit alias for all subqueries in FROM.
1 parent d985079 commit 7cc382e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

postgresqleu/confreg/mail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class AttendeeEmailQuerySampleMixin:
2222
def get_sample_attendee(self):
23-
ret = exec_to_dict("SELECT regid FROM ({}) WHERE regid IS NOT NULL".format(self.query), self.queryparams)
23+
ret = exec_to_dict("SELECT regid FROM ({}) AS reglist WHERE regid IS NOT NULL".format(self.query), self.queryparams)
2424
if ret:
2525
return ConferenceRegistration.objects.get(pk=ret[0]['regid'])
2626
else:

0 commit comments

Comments
 (0)