Skip to main content

User for PostgreSQL monitoring

To be able to monitor a PostgreSQL instance, it is necessary to create a monitoring user with restricted permissions.

First we connect to the instance:

 psql "host=host port=5432 dbname=db [email protected] sslmode=require"

We create the user:

 CREATE USER user_readonly LOGIN PASSWORD 'userpassword';

Add read permissions to the user:

 GRANT CONNECT ON DATABASE my_database TO user_readonly;
 GRANT USAGE ON SCHEMA public TO user_readonly;
 GRANT SELECT ON ALL TABLES IN schema public TO user_readonly;
Close Menu

WHERE TO FIND US


PARIS

Bâtiment Crisco Duo
7 avenue de la Cristallerie
92310 Sèvres, France

NANTES

Centre d’affaires Euptouyou
4 rue Edith Piaf Immeuble Asturia C
44800 Saint-Herblain, France

PHONE

+33 1 46 48 26 00

EMAIL

[email protected]