Re: Delete cascade trigger runs security definer

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean_rasheed(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Delete cascade trigger runs security definer
Date: 2008-11-14 15:56:21
Message-ID: 27304.1226678181@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dean Rasheed <dean_rasheed(at)hotmail(dot)com> writes:
> I have a table with a trigger on it, designed to run security
> invoker. In my real code this accesses a temporary table belonging to
> the invoker.

> Then I have second table, together with a foreign key between them and
> a delete cascade from the second to the first table. It appears that
> when I delete from this second table, the deletes cascade as expected,
> but the trigger is invoked as if it were security definer, which I
> didn't expect.

Referential integrity actions execute as the owner of the table, so
anything triggered by them would execute as the owner too.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message paulo matadr 2008-11-14 16:17:04 Enc: Help to replace caracter
Previous Message Tom Lane 2008-11-14 15:23:00 Re: Tweaking PG (again)