How to add new user um database postgress cluster

Hello how are you? I need to create a new user for a specific database within my postgres ql cluster, how can I do it, this user will not be able to access the other databases (different clients)

I tried with the basic creation commands, however the authentication error.

create user MYUSER with ENCRYPTED password 'MYPASSWORD';
grant all privileges on DATABASE db to MYUSER;

Already grateful for the attention.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @leobueno1982,

You can see this DOC where it explains how add or delete users or databases to a database cluster.

Hope helps you, Sergio Turpín