Re: insert through function only

Поиск
Список
Период
Сортировка
От Brent Wood
Тема Re: insert through function only
Дата
Msg-id 20040504103312.L73279-100000@storm.niwa.co.nz
обсуждение исходный текст
Ответ на insert through function only  (Marvin McNett <mmcnett@cs.ucsd.edu>)
Список pgsql-general

On Mon, 3 May 2004, Marvin McNett wrote:

> How do I go about ensuring that data is only added to a table through a
> function?  I've tried granting execute persission on the function which
> inserts data, but can't get it to work unless the user also has insert
> permission on the table.  I don't want the user to be able to
> arbitrarily insert data.
>

Maybe something along these lines?

Have the function grant insert to the user prior to inserting & revoke it
afterwards. The user will have generic insert access while the function is
running, but if this is a problem, have the function lock the table
during the insert operation, then revoke the insert permision before
unlocking the table.

Brent Wood


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

Предыдущее
От: darkburgundi@onlinehome.de (Bastian)
Дата:
Сообщение: Verhindern, dass im Mehrbenutzerbetrieb mit veralteten Daten gearbteitet wird
Следующее
От: Chris Kratz
Дата:
Сообщение: Re: example database setup