Re: [GENERAL] Delete cascade trigger runs security definer

2008-11-15 Thread Tom Lane
Dean Rasheed <[EMAIL PROTECTED]> writes: >> Referential integrity actions execute as the owner of the table, so >> anything triggered by them would execute as the owner too. > Hmm, that opens up a very nasty gotcha, as shown by the script > below. What user1 does looks, at first sight, fairly inno

Re: [GENERAL] Delete cascade trigger runs security definer

2008-11-15 Thread Dean Rasheed
> Referential integrity actions execute as the owner of the table, so > anything triggered by them would execute as the owner too. > > regards, tom lane Hmm, that opens up a very nasty gotcha, as shown by the script below. What user1 does looks, at first sight, fairly innoc

Re: [GENERAL] Delete cascade trigger runs security definer

2008-11-14 Thread Tom Lane
Craig Ringer <[EMAIL PROTECTED]> writes: > Is the search_path reset in some way that's not visible in > pg_catalog.pg_settings when the ON DELETE CASCADE is issued? No, I don't believe so. Perhaps your test case was simply fooled by plan caching within the trigger function? In general the soluti

Re: [GENERAL] Delete cascade trigger runs security definer

2008-11-14 Thread Craig Ringer
Tom Lane wrote: > Dean Rasheed <[EMAIL PROTECTED]> 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 dele

Re: [GENERAL] Delete cascade trigger runs security definer

2008-11-14 Thread Tom Lane
Dean Rasheed <[EMAIL PROTECTED]> 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 secon

[GENERAL] Delete cascade trigger runs security definer

2008-11-14 Thread Dean Rasheed
Sorry, Opera removed all the newlines from my last post. Trying again in Firefox... Hi, I'm not sure if the following is a bug. I certainly found it surprising, but maybe more experienced users won't. I have a table with a trigger on it, designed to run security invoker. In my real code this ac

[GENERAL] Delete cascade trigger runs security definer

2008-11-14 Thread Dean Rasheed
Hi,I'm not sure if the following is a bug. I certainly found itsurprising, but maybe more experienced users won't.I have a table with a trigger on it, designed to run securityinvoker. In my real code this accesses a temporary table belonging tothe invoker.Then I have second table, together with