django-debug-toolbar icon indicating copy to clipboard operation
django-debug-toolbar copied to clipboard

Fix PostgreSQL compatibility issues in CI and SQL profiling

Open abdibaker opened this issue 4 months ago • 0 comments

Description

This PR fixes PostgreSQL compatibility issues that were causing CI pipeline failures. The main issue was that the SQL panel's profiling feature was attempting to use MySQL-specific commands on PostgreSQL databases, resulting in errors like "unrecognized configuration parameter profiling".

Additionally, the CI configuration had missing environment variables for PostgreSQL test jobs and a malformed lint job configuration.

Key Changes:

  • Added vendor detection to SQL panel profiling to prevent MySQL-specific commands on other databases
  • Fixed CI PostgreSQL job environment variables (DB_NAME, DB_USER, DB_PASSWORD)
  • Fixed malformed lint job strategy configuration
  • Added comprehensive tests for PostgreSQL compatibility

Root Cause: The SQLSelectForm.profile() method was executing MySQL-specific SET PROFILING commands and querying information_schema.profiling without checking the database vendor, causing PostgreSQL CI jobs to fail.

Solution: Added vendor detection that raises a clear ValueError for non-MySQL databases, preventing the MySQL-specific code from executing on PostgreSQL/SQLite.

Fixes #2185

Checklist:

  • [x] I have added the relevant tests for this change.
  • [x] I have added an item to the Pending section of docs/changes.rst.

abdibaker avatar Aug 15 '25 11:08 abdibaker