私は、私は次のようでしたそのため、新たな所有者でPostgreSQLデータベースを作成しようとしています:Postgresqlのアクセス制御
postgres=# create user saurabhd;
postgres=# CREATE DATABASE test_db OWNER saurabhd;
postgres=# ALTER USER saurabhd PASSWORD 'spassword'
明らかに、新しいユーザとデータベースはpostgresユーザ(デフォルトユーザー)から作成されました。 \ lコマンドは、以下を示した:
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
template0 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
test_db | saurabhd | UTF8 | en_GB.UTF-8 | en_GB.UTF-8 |
分かるように、データベースTEST_DBの所有者名がsaurabhdあります。しかし、私はまだ 'postgres'ユーザでDB test_dbにアクセスし、DBを修正することができます。
方法はありますか?私はpostgresユーザー(およびsaurabhd以外のすべてのユーザー)がDBのtest_dbにアクセスすることを制限できますか?