How to turn on PostgreSQL VERBOSITY in django db connection?

后端 未结 1 1246
一向
一向 2021-01-26 16:42

This is a follow up question to this:

Postgres: More verbose error message: I am missing the table name

PostgreSQL 9.6 improved error messages with version 9.6.

相关标签:
1条回答
  • 2021-01-26 16:50

    Try this

    # settings.py
    DATABASES = {
        'default': {
            'ENGINE': '...',
            'OPTIONS': {
                'init_command': "SET log_error_verbosity TO 'verbose'",
            },
        }
    }
    

    Test query

    SELECT setting FROM pg_settings WHERE name = 'log_error_verbosity'
    
    0 讨论(0)
提交回复
热议问题