Re: where table privileges are stored

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: where table privileges are stored
Дата
Msg-id 20150507150725.GB30322@tamriel.snowman.net
обсуждение исходный текст
Ответ на where table privileges are stored  ("Markova, Nina" <Nina.Markova@NRCan-RNCan.gc.ca>)
Ответы Re: where table privileges are stored
Re: where table privileges are stored
Список pgsql-admin
Nina,

* Markova, Nina (Nina.Markova@NRCan-RNCan.gc.ca) wrote:
> I need to check in a GUI if a user has certain privileges on the table he is trying to modify - insert/update/delete.

You probably want to use the "has_table_privilege" family of functions.

Look here: http://www.postgresql.org/docs/9.4/static/functions-info.html

> Something I could query system catalogs about:
>   Select  ...  from ... where table_name  = 'MYTABLE';
>
> Does Postgres store user privileges on tables in format similar to the one below, I mean the info below to be stored
asa text field somewhere? 
>    grant delete on MYTABLE  to myuser
>    grant insert on  MYTABLE  to myuser

Privileges are stored in the catalog tables but not is a terribly useful
format for querying, which is why the helper functions exist.  If you
want to look at it though, look at pg_class.relacl.

    Thanks!

        Stephen

Вложения

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

Предыдущее
От: "Markova, Nina"
Дата:
Сообщение: where table privileges are stored
Следующее
От: "Markova, Nina"
Дата:
Сообщение: Re: where table privileges are stored