I've just started working with Postgres and I noticed the following.
If I create a user they automatically have the ability to do whatever they want inside the database. User was created with:
CREATE ROLE read_access
NOLOGIN NOSUPERUSER INHERIT
NOCREATEDB NOCREATEROLE NOREPLICATION;
So I tried:
REVOKE ALL ON DATABASE dbname FROM USER username ;
GRANT CONNECT ON DATABASE dbname TO username ;
I expected the user should be able to connect to the db with no further privileges on the underlying objects. But this user is still able to create objects inside the database. What am I missing here?
ALTER DEFAULT PRIVILEGES, as suggested in the linked answer. – ypercubeᵀᴹ Jul 20 '16 at 18:59