[Django] #36637: Django 5.0.2 and psycopg3

4 views
Skip to first unread message

Django

unread,
Oct 3, 2025, 10:22:56 AM (3 days ago) Oct 3
to django-...@googlegroups.com
#36637: Django 5.0.2 and psycopg3
-------------------------------------+-------------------------------------
Reporter: marcosng716 | Type: Bug
Status: new | Component:
| Uncategorized
Version: 5.0 | Severity: Normal
Keywords: psycopg, postgres | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
I am running a Django project with Postgres 17. When running tests using
''pytest'' I notice random inestabilities.
Doing some research I found psql17 is not fully supported by psycopg2, so
I tried moving from psycopg2-binary==2.9.9 to psycopg-binary==3.2.1.

Deleted old env, created new one and I get errors everywhere.
Apparently Django still requires psycopg2 internally even tho I am setting
my settings.py file to use psycopg3:

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('DB_NAME', 'name'),
'USER': os.getenv('DB_USER', 'user'),
'PASSWORD': os.getenv('DB_PASS', 'pass'),
'HOST': os.getenv('DB_HOST', '127.0.0.1'),
'PORT': '5432'
}
}

---

Am I doing something wrong? Or this doc is tricky?
https://docs.djangoproject.com/en/5.0/ref/databases/
--
Ticket URL: <https://code.djangoproject.com/ticket/36637>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Oct 3, 2025, 10:25:23 AM (3 days ago) Oct 3
to django-...@googlegroups.com
#36637: Django 5.0.2 and psycopg3
-----------------------------------+--------------------------------------
Reporter: marcosng716 | Owner: (none)
Type: Bug | Status: new
Component: Uncategorized | Version: 5.0
Severity: Normal | Resolution:
Keywords: psycopg, postgres | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Description changed by marcosng716:

Old description:

> I am running a Django project with Postgres 17. When running tests using
> ''pytest'' I notice random inestabilities.
> Doing some research I found psql17 is not fully supported by psycopg2,
> so I tried moving from psycopg2-binary==2.9.9 to psycopg-binary==3.2.1.
>
> Deleted old env, created new one and I get errors everywhere.
> Apparently Django still requires psycopg2 internally even tho I am
> setting my settings.py file to use psycopg3:
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.postgresql',
> 'NAME': os.getenv('DB_NAME', 'name'),
> 'USER': os.getenv('DB_USER', 'user'),
> 'PASSWORD': os.getenv('DB_PASS', 'pass'),
> 'HOST': os.getenv('DB_HOST', '127.0.0.1'),
> 'PORT': '5432'
> }
> }
>
> ---
>
> Am I doing something wrong? Or this doc is tricky?
> https://docs.djangoproject.com/en/5.0/ref/databases/

New description:

I am running a Django project with Postgres 17. When running tests using
''pytest'' I notice random inestabilities.
Doing some research I found psql17 is not fully supported by psycopg2, so
I tried moving from psycopg2-binary==2.9.9 to psycopg-binary==3.2.1.

Deleted old env, created new one and I get errors everywhere.
Apparently Django still requires psycopg2 internally even tho I am setting
my settings.py file to use psycopg3:

{{{#!div style="font-size: 80%"
Code highlighting:
{{{#!python

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv('DB_NAME', 'name'),
'USER': os.getenv('DB_USER', 'user'),
'PASSWORD': os.getenv('DB_PASS', 'pass'),
'HOST': os.getenv('DB_HOST', '127.0.0.1'),
'PORT': '5432'
}
}

}}}
}}}
---

Am I doing something wrong? Or this doc is tricky?
https://docs.djangoproject.com/en/5.0/ref/databases/

--
--
Ticket URL: <https://code.djangoproject.com/ticket/36637#comment:1>

Django

unread,
Oct 3, 2025, 10:35:34 AM (3 days ago) Oct 3
to django-...@googlegroups.com
#36637: Django 5.0.2 and psycopg3
-----------------------------------+--------------------------------------
Reporter: marcosng716 | Owner: (none)
Type: Bug | Status: closed
Component: Uncategorized | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: psycopg, postgres | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------------------------
Changes (by Jacob Walls):

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

Comment:

Hello,

This report seems better suited to be a support request. The best place to
get answers to your issue is using any of the user support channels from
[https://docs.djangoproject.com/en/dev/faq/help/#how-do-i-do-x-why-
doesn-t-y-work-where-can-i-go-to-get-help this link].

Since the goal of this issue tracker is to track issues about Django
itself, and your issue seems, at first, to be located in your custom code,
I'll be closing this ticket as `invalid` following the
[https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#closing-tickets ticket triaging process]. If, after debugging,
you find out that this is indeed a bug in Django, please re-open with the
specific details and please be sure to include a small Django project to
reproduce or a failing test case.

Thank you!
--
Ticket URL: <https://code.djangoproject.com/ticket/36637#comment:2>
Reply all
Reply to author
Forward
0 new messages