Foreign keys and permissions oddity

Поиск
Список
Период
Сортировка
От Joshua Tolley
Тема Foreign keys and permissions oddity
Дата
Msg-id 4c5ca528.12968e0a.1d7c.7f80@mx.google.com
обсуждение исходный текст
Ответы Re: Foreign keys and permissions oddity  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Is there some justification for this behavior that I should know already? It
seemed awfully strange when some folkds here stumbled on it:

$ create user a;
$ create user b;
$ commit;
$ \c - a
$ create table foo (id integer primary key);
$ revoke all on foo from a;
$ grant all on foo to b;
$ commit;
$ \c - b
$ create table bar (foo_id integer references foo (id));
$ commit;
$ insert into bar values (1);
ERROR:  permission denied for relation foo
CONTEXT:  SQL statement "SELECT 1 FROM ONLY "public"."foo" x WHERE "id" OPERATOR(pg_catalog.=) $1 FOR SHARE OF x"

The key point seems to be that the owner of the referenced table has no
permissions on the table, although the referencing user does.

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

Вложения

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

Предыдущее
От: "Joshua J. Kugler"
Дата:
Сообщение: Re: MySQL versus Postgres
Следующее
От: Sandeep Srinivasa
Дата:
Сообщение: Re: MySQL versus Postgres