UPDATE: update from psycopg2 to psycopg3
Closed this issue · 4 comments
In the release notes for Django 4.2 it's mentioned that psycopg2 will be at some point deprecated in the future versions. We should think about moving to psycopg3.
Differences to psycopg2.
After some testing it seems that only the following method was incompatible with psycopg3
daiquiri/daiquiri/core/adapter/database/postgres.py
Lines 99 to 102 in 5ae2a14
It should be changed to
def fetch_pid(self):
return self.connection().connection.info.backend_pid
For now, it feels a bit suspicious that the psycopg update requires only such a tiny fix in daiquiri.
I think, from Django or postgres point of view, it is super weird that a web application needs the pid of the query process. I think we need it to abort the query, right? This is not what people usually do.
Yes, the PID is used to abort to query
daiquiri/daiquiri/core/adapter/database/postgres.py
Lines 148 to 152 in 5ae2a14
@jochenklar Do you think that query should be aborted in a different way?
No, I am hoping that this feature will not be removed altogether 😄