Re: BUG #18456: Trigger data in plpython3u trigger-function changes in AFTER UPDATE OR INSERT trigger - Mailing list pgsql-bugs

From Jacques Combrink
Subject Re: BUG #18456: Trigger data in plpython3u trigger-function changes in AFTER UPDATE OR INSERT trigger
Date
Msg-id CAO2Kw=fU9qa48Gj9-OKCwBUEGZAtUm+UDT=Sb+EPjroxmEC8Vw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18456: Trigger data in plpython3u trigger-function changes in AFTER UPDATE OR INSERT trigger  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #18456: Trigger data in plpython3u trigger-function changes in AFTER UPDATE OR INSERT trigger
Re: BUG #18456: Trigger data in plpython3u trigger-function changes in AFTER UPDATE OR INSERT trigger
List pgsql-bugs
Okay thanks for confirming.

Is there something that I can do to get this issue on a list to be fixed, or is this report enough?

Sorry for the questions, first time posting here, not sure how everything works.

Regards
GoodX Logo
Jacques Combrink
Software Developer
telephone012 845 9888
emailadjacques@quantsolutions.co.za
GoodX WebsiteGoodX YouTubeGoodX FacebookGoodX LinkedInGoodX Instagram
GoodX Group Logos


On Sat, May 4, 2024 at 8:34 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
PG Bug reporting form <noreply@postgresql.org> writes:
> Then the trigger data changes after the insert statement in the trigger
> function.

Hmm.  TD is defined as a global dictionary like SD, so it saves values
across calls to the plpython function.  So the inner INSERT operation
fires the same trigger, which decides not to print anything, but
nonetheless it's changed TD and the outer trigger call will see that.

There used to be similar problems in plain plpython functions if they
were invoked recursively, because named function arguments are also
passed as global variables.  We fixed that in a rather hacky way in
1d2fe56e4, ie save and restore those globals when recursing.
Probably the same thing could be done with TD.

                        regards, tom lane

pgsql-bugs by date:

Previous
From: 周志勤
Date:
Subject: Re: Re: edb installation failed for pgadmin when username is Chinese under c;\user #7432
Next
From: Jacques Combrink
Date:
Subject: Re: BUG #18456: Trigger data in plpython3u trigger-function changes in AFTER UPDATE OR INSERT trigger