I am new at Postgresql that's why I can't figure out some privileges here.
Database called Denemedb23 is already created. I created the user NoxUser.
I executed these commands:
REVOKE ALL PRIVILEGES ON DATABASE Denemedb23 FROM public;GRANT CONNECT ON DATABASE Denemedb23 TO NoxUser;
I want Noxuser just to be able to login to the database and he should not be able to create table/function etc. But NoxUser can create a table in the database.
Could you help me to figure out why?
The CONNECT permission in PostgreSQL enables a user to establish a connection to a database, but it does not provide the user the power to create tables or carry out other tasks.
In your instance, you have given NoxUser the CONNECT privilege and removed all database rights from the public role. However, the CREATE privilege on the schema is required in order to create tables.
So, make sure the user does not have the CREATE privilege on the schema in order to accomplish your aim of enabling NoxUser to connect to the database but prevent them from creating tables.
Run these commands, these guarantee that although NoxUser can connect to the Denemedb23 database but cannot create tables in the public schema.
Hope it's helpful :)