﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
32588	Exception handling in contrib.postgres	Jan Holas		"When using contrib.postgres extension, this extension registers handlers that run Postgres-specific queries (feature discovery)
https://github.com/django/django/blob/main/django/contrib/postgres/signals.py#L16

If you create a connection via psycopg2 to non-Postgres database (Redshift for example), the ProgrammingError exception should be ignored. 
https://github.com/django/django/blob/main/django/contrib/postgres/signals.py#L44

The problem is that this is catching psycopg2.ProgrammingError while when you make a new connection the exception is wrapped to 
django.db.utils.ProgrammingError in
https://github.com/django/django/blob/main/django/db/utils.py#L90

so the exceptions don't match and it's propagated to whatever caller created a connection. 
"	Bug	closed	contrib.postgres		Normal	invalid			Unreviewed	0	0	0	0	0	0
