How to prevent a user from being able to see other databases and the tables from other databases?

前端 未结 3 445
暗喜
暗喜 2021-02-01 05:19

I want to create a postgres user that can access only one database on the postgres server at all.

Currently my flow is:

create database database1;
create         


        
3条回答
  •  情深已故
    2021-02-01 06:06

    By default any objects you create are created in the public schema. Also, any users that you create have CREATE and USAGE privileges on the public schema. You should revoke CREATE and USAGE to the public schema for this user, or you should change the default access level. You'll also need to move the database to which this user has access into the user's schema, or a schema accessible to the user. See DDL Schemas in the Postgres manual.

提交回复
热议问题