Re: [GENERAL] delete cascade not working

2009-04-25 Thread Joshua Tolley
On Sat, Apr 25, 2009 at 04:21:06PM -0400, Kenneth Tilton wrote: > But I am "inheriting" from the parent, so everything about the parent > should be true for me unless overridden. I mean in the usual sense of > inherit I know from OO. This is from the current docs (http://www.postgresql.org/doc

Re: [GENERAL] delete cascade not working

2009-04-25 Thread Kenneth Tilton
Joshua Tolley wrote: On Sat, Apr 25, 2009 at 04:01:20PM -0400, Kenneth Tilton wrote: Given constraint: ALTER TABLE provider_input.common ADD CONSTRAINT common_pin_file_load_sid_fkey FOREIGN KEY (pin_file_load_sid) REFERENCES provider_input.file_load (sid) MATCH FULL ON UPDATE

Re: [GENERAL] delete cascade not working

2009-04-25 Thread Joshua Tolley
On Sat, Apr 25, 2009 at 04:01:20PM -0400, Kenneth Tilton wrote: > Given constraint: > > ALTER TABLE provider_input.common > ADD CONSTRAINT common_pin_file_load_sid_fkey FOREIGN KEY > (pin_file_load_sid) > REFERENCES provider_input.file_load (sid) MATCH FULL > ON UPDATE NO ACTION ON

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

Re: [GENERAL] Delete cascade and trigger permissions?

2006-07-06 Thread Michael Fuhr
On Thu, Jul 06, 2006 at 02:06:46PM -0400, Brennan, Sean (IMS) wrote: > All in the same db connection, I do the following: > 1)create a temp table > 2)delete rows from the main table > 3)access the temp table in the delete trigger of the main table > 4)access the temp table in the delete trigger of

Re: [GENERAL] Delete Cascade

2001-03-12 Thread Stephan Szabo
Add ON DELETE CASCADE to the references in book. On Mon, 12 Mar 2001, Marcelo Pereira wrote: > Hi, > > I am in trouble deleting rows in cascade. > > I have a scheme like this: > > create table author (author_cod integer primary key, author_name char(20)); > create table book (book_cod intege