From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | "harding(dot)ian(at)gmail(dot)com" <harding(dot)ian(at)gmail(dot)com> |
Cc: | General PostgreSQL List <pgsql-general(at)postgresql(dot)org> |
Subject: | AFTER UPDATE trigger updating other records |
Date: | 2018-01-25 19:10:26 |
Message-ID: | CAKFQuwbYTA1TzKw0pXrup8D3TZL_O6aWwd8YcM108Cu4bWLudg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wednesday, January 24, 2018, Ian Harding <harding(dot)ian(at)gmail(dot)com> wrote:
>
> -- This is not what I expect to see. I have even tried running the update
> -- unrestricted from within the trigger but I get the same result. From
> -- outside the trigger I run the update unrestricted...
>
> UPDATE area SET areapath = (select areapath from area a where areaid =
> area.parentid) || subpath(areapath, nlevel(areapath) - 1) where parentid is
> not null;
>
> -- And I see what I expected.
>
>
I'd start thinking that the function that the trigger is executing is not
the one that I am editing. Adding raise notice to the function should give
you some confirmation as to what is firing.
Are rows beside the one your are updating not changing or not changing
correctly.
A self-contained example script would help you with isolation and us if you
still cannot figure it out after writing one.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | Jeremy Schneider | 2018-01-25 20:03:36 | Logical decoding of TRUNCATE vs DELETE |
Previous Message | Adrian Klaver | 2018-01-25 18:51:08 | Re: AFTER UPDATE trigger updating other records |