Tom Lane wrote:
You should just do
if new.parent <> old.parent then
new.name = ''old'';
As you have it, the inner UPDATE pre-empts the outer because it is
applied first. When control comes back from the trigger, the row
the trigger was handed is now dead (already updated) and can't be
update
Mage <[EMAIL PROTECTED]> writes:
> what's wrong with this?
> if new.parent <> old.parent then
>update test set name = ''old'' where parent = old.parent;
You should just do
if new.parent <> old.parent then
new.name = ''old'';
As you have it, the inner UPDATE pre-empts the outer because
Hi,
what's wrong with this?
---
create table test (id int, name text, parent int);
insert into test values (1,'a',1);
insert into test values (2,'b',1);
insert into test values (3,'c',1);
create or replace function test() returns trigger as '
begin
raise info ''id: %, oldname: %'',old.id, o