U123: Permission denied

Category: Application / User Errors
SQLSTATE: 42501 (Class 42 — Syntax Error or Access Rule Violation: insufficient_privilege)
Urgency: medium

Example Postgres Log Output:

ERROR: permission denied for schema my_schema at character 25
STATEMENT: SELECT * FROM my_schema.table


This error occurs when the connected user is not allowed to access the relation or object referenced by the query.

Recommended Action:

Review whether the query was produced by a misconfiguration of an application (e.g. connecting with the wrong role), or a DBA accessing the wrong table by accident.

If you make extensive use of the Postgres role system, and allow third party access for some roles, this may also be a security relevant event, e.g. when somebody tries to enumerate which tables can be accessed by a restricted user.

Learn More:

Download Free eBook: The Top 6 Postgres Log Events
Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →