I'm trying to give a new user all permissions for an existing database. I had run the following commands:
CREATE USER new_user WITH PASSWORD 'pass';
GRANT CONNECT ON DATABASE my_base TO new_user;
GRANT USAGE ON SCHEMA public TO new_user;
GRANT ALL PRIVILEGES ON DATABASE my_base TO new_user;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO new_user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO new_user;
GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public TO new_user;
After connecting as the user new_user
I can see all tables, but trying to SELECT
on any table yields: [42501] ERROR: permission denied for relation [name of table]
Command \l
list new_user
in an Access privileges.
Command \z
list 0 rows.
Version: PostgreSQL 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, 64-bit