Skip site navigation (1) Skip section navigation (2)

Re: bug or feature?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Евгений Гридасов <eugene(at)spider(dot)ru>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: bug or feature?
Date: 2002-12-11 16:37:28
Message-ID: 20021211083619.V93553-100000@megazone23.bigpanda.com (view raw or flat)
Thread:
Lists: pgsql-bugs
On Fri, 6 Dec 2002, [Windows-1251]   wrote:

> Hello there
> have some problems on 7.2.3/freebsd
>
> ex.
> table1 has 2 columns: id and name
> table2 has 3 columns: id, t1_id(references t1(id) on delete cascade) and
> 'name' field
>
> i got a procedure (plpgsql)
>
> declare i int;
> begin
>   select count(*) into i from table2 where t1_id=123;
>   raise notice ''rows selected: %'',i;
>   delete from table1 where id=123;
>   select count(*) into i from table2 where t1_id=123;
>   raise notice ''rows selected: %'',i;
> end;
>
>  the constraint trigger on delete executes ONLY after procedure
>  completion, but it does not execute right after delete. WHY?

It's considered to run at the end of statement (where the statement
in question is the statement that calls the plpgsql function).  There's
been arguments about the timing of the referential actions, but I believe
this is currently the expected behavior.



In response to

  • bug or feature? at 2002-12-06 06:59:22 from Евгений Гридасов

pgsql-bugs by date

Next:From: Joe ConwayDate: 2002-12-11 18:18:08
Subject: Re: ON DELETE triggers don't work as documented
Previous:From: David F. SkollDate: 2002-12-11 16:10:47
Subject: Segmentation fault inside libpq with PHP

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group