PostgreSQL:Roles
lastmod 2026-11-10created 2024-02-075 edits
Roles in PostgreSQL are the unit for managing database access privileges, unifying users and groups into a single concept. A role is created with CREATE ROLE and holds attributes such as LOGIN, SUPERUSER, and CREATEDB as well as object privileges granted with GRANT; granting a role to other roles lets it be used like a group. Row Level Security policies are applied based on the current role, and Supabase distinguishes API access with predefined roles such as anon, authenticated, and service_role.