Re: Cascade delete triggers change user credentials

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Cascade delete triggers change user credentials
Дата
Msg-id 20040216134422.D19658@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Cascade delete triggers change user credentials  (Antonios Christofides <anthony@itia.ntua.gr>)
Ответы Re: Cascade delete triggers change user credentials  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Cascade delete triggers change user credentials  (Antonios Christofides <anthony@itia.ntua.gr>)
Список pgsql-general
On Mon, 16 Feb 2004, Antonios Christofides wrote:

> Hi, I've prepared a test case about this, which I include below. I
> have tables "a" and "b"; "b" has a foreign key to "a", on delete
> cascade. In addition, there is a "before delete on b" trigger, which
> all that does is show the current_user. If a row is deleted from "a",
> and this triggers a delete from "b", which in turn activates the
> show_current_user trigger, the triggered function selects
> "current_user", and the result is the user who created "b", not the
> currently connected user.
>
> Is this a bug? Is there any workaround? I'm running Debian 3.0 with
> its prepackaged PostgreSQL 7.2.1. I greatly appreciate your help.

The triggered actions occur as if done by the owner of the fktable so that
they will not fail if the current user does not actually have delete
access on that table. I'm not sure which result for current_user makes
more sense in that context for further triggered actions.

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: to_char problem
Следующее
От: Troy Campano
Дата:
Сообщение: Re: [ADMIN] create ONE database beyond between 2 server