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

From: Jacques Combrink <jacques(at)quantsolutions(dot)co(dot)za>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #18456: Trigger data in plpython3u trigger-function changes in AFTER UPDATE OR INSERT trigger
Date: 2024-05-06 08:23:24
Message-ID: CAO2Kw=fU9qa48Gj9-OKCwBUEGZAtUm+UDT=Sb+EPjroxmEC8Vw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
[image: GoodX Logo] <https://www.goodx.healthcare>
Jacques Combrink
Software Developer

[image: telephone] 012 845 9888
[image: emailad] jacques(at)quantsolutions(dot)co(dot)za

[image: GoodX Website] <https://www.goodx.healthcare> [image: GoodX YouTube]
<https://www.youtube.com/channel/UCX235mj63BB9gb9YUSxe7Bg> [image: GoodX
Facebook] <https://www.facebook.com/GoodXSoftware/> [image: GoodX LinkedIn]
<https://www.linkedin.com/company/goodx-software/> [image: GoodX Instagram]
<https://www.instagram.com/goodx_software/>

[image: GoodX Group Logos] <https://www.goodx.healthcare>

On Sat, May 4, 2024 at 8:34 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> PG Bug reporting form <noreply(at)postgresql(dot)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
>

In response to

Responses

Browse pgsql-bugs by date

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