8000 Fixed #32770 -- Added system check to ensure `django.contrib.postgres` in `INSTALLED_APPS` when using its features. by cliff688 · Pull Request #19480 · django/django · GitHub
[go: up one dir, main page]

Skip to content

Fixed #32770 -- Added system check to ensure django.contrib.postgres in INSTALLED_APPS when using its features. #19480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cliff688
Copy link
Contributor

Trac ticket number

ticket-32770

Branch description

Provide a concise overview of the issue or rationale behind the proposed changes.

Checklist

  • This PR targets the main branch.
  • The commit message is written in past tense, mentions the ticket number, and ends with a period.
  • I have checked the "Has patch" ticket flag in the Trac system.
  • I have added or updated relevant tests.
  • I have added or updated relevant docs, including release notes if applicable.
  • I have attached screenshots in both light and dark modes for any UI changes.

@cliff688 cliff688 force-pushed the ticket-32770 branch 5 times, most recently from ccac97e to 66c64f6 Compare May 18, 2025 17:54
Copy link
Member
@charettes charettes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling it Clifford, I'm sure this will prevent a lot of head scratching!

Any thoughts about using a single error code for constraints, indexes, and fields?

@cliff688 cliff688 changed the title Fixed #32770 -- Added contrib.postgres dependency check for PostgreSQL-specific fields, indexes and constraints. Fixed #32770 -- Added system check to ensure django.contrib.postgres in INSTALLED_APPS` when using its features. May 19, 2025
@cliff688 cliff688 changed the title Fixed #32770 -- Added system check to ensure django.contrib.postgres in INSTALLED_APPS` when using its features. Fixed #32770 -- Added system check to ensure django.contrib.postgres in INSTALLED_APPS when using its features. May 19, 2025
…is installed when using its features.

Added postgres.E005 to validate 'django.contrib.postgres' is in INSTALLED_APPS
when using:
* PostgreSQL-specific fields (ArrayField, HStoreField, range fields, SearchVectorField),
* PostgreSQL indexes (PostgresIndex and all subclasses), and
* ExclusionConstraint

The check provides immediate feedback during system checks rather than failing
later with obscure runtime and database errors.

Thanks Simon Charette for the review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0