When I create a new user for the database without any rights, this new user can still see all the schemas/tables etc. He can't access them, but he still sees them. I would like to revoke these privileges, but do not know how.
This is how I created the user:
CREATE USER wouter_test WITH PASSWORD 'wouter_test'
NOSUPERUSER NOCREATEDB NOCREATEROLE NOCREATEUSER INHERIT;
based on this post I thought it may have to do with rights that users have to the public schema and the information the public schema contains: https://dba.stackexchange.com/questions/98892/minimal-grants-for-readonly-single-table-access-on-postgresql
Based on the wikisite: https://wiki.postgresql.org/wiki/Shared_Database_Hosting I used this command
REVOKE ALL ON SCHEMA public FROM wouter_test;
It did not work. The following did not seem to work either (to prevent the user from seeing and accessing a database called klm)
REVOKE connect ON DATABASE klm FROM wouter_test;
But still the user, in PGAdmin, can see all the databases, schemas and tables (including klm).
What am I doing wrong?
PUBLICrole, not about thepublicschema. (Technically it mentions the schema too, but only says that it's usually not used, so it can be dropped altogether, instead of revoking/granting rights on it.)PUBLIC(but note thatPUBLICalso covers already created users too).PUBLIC: newly created ones as well as old ones.GRANTfor those you want to keep permissions beforeREVOKEfromPUBLIC.