PostgreSQL - relation does not exist error while providing priviliges

I entered the postgres console with sudo and did the following:

create user uu with password 'uu'; create database u_db owner uu; grant all privileges on u_db to uu; 

Error: Relation u_db does not exist.

+7
postgresql
source share
1 answer

To provide here you need to use the DATABASE keyword. So I am sending you the output from psql to:

 postgres=# create user uu with password 'uu'; CREATE ROLE postgres=# create database u_db owner uu; CREATE DATABASE postgres=# grant all privileges on u_db to uu; FEHLER: Relation ยปu_dbยซ existiert nicht postgres=# grant all privileges on database u_db to uu; GRANT 

But. IMHO, through setting up the database owner, you do not need to provide additional rights for the uu user.

+13
source share

All Articles