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 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
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.
From | Date | Subject | |
---|---|---|---|
Next Message | Joe Conway | 2002-12-11 18:18:08 | Re: ON DELETE triggers don't work as documented |
Previous Message | David F. Skoll | 2002-12-11 16:10:47 | Segmentation fault inside libpq with PHP |