DBAtlas · Database operations atlas

42501: insufficient_privilege

PostgreSQL

What does it mean?

The role does not have the privilege required for the operation it is attempting.

Why does it happen?

The required GRANT on the table/schema/database was not given, USAGE on the schema is missing, the object belongs to a different role, or row-level security (RLS) policies block access.

How to fix it

Grant the missing privilege: GRANT SELECT, INSERT ON my_table TO app_role; for the schema GRANT USAGE ON SCHEMA app_schema TO app_role. For bulk grants use GRANT ... ON ALL TABLES IN SCHEMA, and ALTER DEFAULT PRIVILEGES for future objects. View current privileges: \dp my_table. If RLS is active, review the relevant policies.

Open in DBAtlas →

More from this engine