Re: granting right to create and delete just one database

Поиск
Список
Период
Сортировка
От Laurenz Albe
Тема Re: granting right to create and delete just one database
Дата
Msg-id 91b121d8f4f2e4a7b85e46f87cf91f634598c88d.camel@cybertec.at
обсуждение исходный текст
Ответ на granting right to create and delete just one database  (Chris Withers <chris@withers.org>)
Ответы Re: granting right to create and delete just one database  (Chris Withers <chris@withers.org>)
Список pgsql-general
Chris Withers wrote:
> Is there any way to grant rights to a user such that they can drop and 
> re-create only a single database?

No; what I'd do if I needed that is to create a SECURITY DEFINER function
that is owned by a user with the CREATEDB privilege.
This function can be called by a normal user that has the EXECUTE privilege
on the function.

Don't forget to "SET search_path" on such a function (as mentioned in the
documentation).  It might also be a good idea to REVOKE EXECUTE on the
function from PUBLIC.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




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

Предыдущее
От: Rob Northcott
Дата:
Сообщение: RE: Query very different speeds on seemingly similar data
Следующее
От: Chris Withers
Дата:
Сообщение: Re: granting right to create and delete just one database