SELECT and nothing else. The agent checks this itself on your machine, every time it starts. If the account can write anywhere in the database, the agent stops with an error and serves nothing.
PostgreSQL
Run as an administrator. Replaceapp with your database name.
ALTER DEFAULT PRIVILEGES covers tables created later by the role that runs it. If another role creates your tables, add FOR ROLE <that_role> after ALTER DEFAULT PRIVILEGES.USAGE, or without a single readable table, does not appear.
MariaDB and MySQL
In MariaDB and MySQL, each database is a schema. GrantSELECT on each one you want to expose:
'%' with the address the agent connects from if you want to restrict it.
What the agent checks
The check covers the whole database, not only the schemas you expose. An account that can write to a table you never expose can still write.- PostgreSQL
- MariaDB and MySQL
The agent refuses the account if:
- it is a superuser;
- it has
INSERT,UPDATE,DELETEorTRUNCATEon any table outside the system catalogs; - on PostgreSQL 15 and later, it has
CREATEon any schema.
CREATE on public to every role by default, so the agent skips the CREATE check there. Revoke it yourself if you can: REVOKE CREATE ON SCHEMA public FROM PUBLIC;1: