GRANT assigns specific privileges on database objects to roles or users.
GRANT attaches privileges—SELECT, INSERT, UPDATE, DELETE, TRIGGER, USAGE, and more—to roles or individual users. PostgreSQL checks these privileges on every statement, so a correct GRANT is mandatory before your ParadeDB users can read vectors or insert data.
Create a role, then grant SELECT on each ParadeDB table (or the entire schema) to that role. Finally, assign the role to your analysts.This isolates read access and keeps write privileges locked down.
-- create a role
.
CREATE ROLE analyst;
-- apply read access to the whole parade schema
GRANT USAGE ON SCHEMA parade TO analyst;
GRANT SELECT ON ALL TABLES IN SCHEMA parade TO analyst;
ALTER DEFAULT PRIVILEGES IN SCHEMA parade
GRANT SELECT ON TABLES TO analyst;
Grant INSERT on the Orders table only to the role that owns order-processing services. Keep UPDATE and DELETE separate to minimize accidental data changes.
Roles centralize permission management. When new users join, you simply grant them the role; you never revisit every table. This pattern also plays nicely with ParadeDB’s schema-level USAGE permission.
ParadeDB often stores vectors in a dedicated schema (e.g., parade). Grant USAGE and SELECT at the schema level to simplify onboarding.
Audit permissions periodically. REVOKE removes privileges immediately and helps comply with least-privilege principles.
Query the catalog view information_schema.role_table_grants
or run \dp
in psql. This lists every object and its privilege string, revealing gaps or excess permissions.
Granting to individual users bloats admin time—always wrap users in roles. Forgetting DEFAULT PRIVILEGES means new tables stay private; fix by altering default privileges right after the first GRANT.
Yes. Separate privileges with commas: GRANT SELECT, INSERT ON Products TO sales_app;
No. GRANT adds to current privileges. Use REVOKE to remove rights.
Use GRANT EXECUTE ON FUNCTION function_name(args) TO role;
so your application can call custom vector search functions.