Re: Preventing access of user1 to user2's database

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Preventing access of user1 to user2's database
Дата
Msg-id 245.1136908673@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Preventing access of user1 to user2's database  (Joao Miguel Ferreira <jmf@estg.ipvc.pt>)
Список pgsql-novice
Joao Miguel Ferreira <jmf@estg.ipvc.pt> writes:
> I created 2 databases (user01db and user02db) owned by each of the
> users.
> Nevertheless, user02 can connect to the database of user01 (and
> vice-versa), create tables, select's, inserts, etc.

This is normal.  If you don't want a particular user to be able to
connect to a particular database at all, you should alter pg_hba.conf
to prevent it.  (As somebody suggested nearby, "sameuser" can be a
handy solution when your standard policy is that each user has a
database named after himself.)

As for what they can do after they've connected, the default behavior
is actually "not much" --- except that the "public" schema in each
database has public CREATE and USAGE permissions, so it's possible to
create tables within that schema.  If you prefer you can lock down
the public schema more, or even remove it altogether.  See the
discussion of privileges in the manual.

            regards, tom lane

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Lane Van Ingen"
Дата:
Сообщение: Error Returned by A Function
Следующее
От: "Lane Van Ingen"
Дата:
Сообщение: Re: Error Returned by A Function