Closed kimakan closed 3 months ago
After some testing it seems that only the following method was incompatible with psycopg3 https://github.com/django-daiquiri/daiquiri/blob/5ae2a14f68bfab0b0d6c261ebce3e6359d6594de/daiquiri/core/adapter/database/postgres.py#L99-L102
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 https://github.com/django-daiquiri/daiquiri/blob/5ae2a14f68bfab0b0d6c261ebce3e6359d6594de/daiquiri/core/adapter/database/postgres.py#L148-L152
@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 😄
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.