Skip to content

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.

@gavinhodge
Copy link
Author

Hi maintainers, does this need any action from my end before it can be reviewed or merged?

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