0

How can I translate textual postgres error messages into error codes?

For example:

permission denied for relation table

How can I find out which error code it belongs to here? https://www.postgresql.org/docs/current/static/errcodes-appendix.html

1 Answer 1

2

Check your log_line_prefix setting in postgresql.conf. Make sure you use this %e option to log the codes in your postgres logs.

%e = SQL state

You can also use \set VERBOSITY verbose in psql to see detailed errors with SQLSTATE there.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.