Skip to content
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

Gracefully handle NotSupportedError during schema introspection #696

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

Conversation

gavinhodge
Copy link

In certain circumstances, a django.db.utils.NotSupportedError can be thrown during schema introspection. If this happens, the exception is unhandled and Django returns a 500 response instead of displaying query results.

To reproduce requires:

  • Postgresql running in recovery mode (typically a hot standby server). This can be simulated without a hot standby server
  • An unlogged table on the primary (ALTER TABLE table_name SET UNLOGGED)
  • Attempt to execute a query (e.g. SELECT 1) against the standby server and receive a 500 error page

Exception detail:

NotSupportedError
cannot access temporary or unlogged relations during recovery

The issue can be worked around by specifying the affected tables in the EXPLORER_SCHEMA_EXCLUDE_TABLE_PREFIXES setting, but this change makes a workaround unnecessary.

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.

1 participant