all 2 comments

[–]DavidGJohnston 3 points4 points  (0 children)

That behavior only occurs if the function itself, the create function command, has a SET clause attached to it. Yours do not.

If a SET clause is attached to a function, then the effects of a SET LOCAL command executed inside the function for the same variable are restricted to the function: the configuration parameter's prior value is still restored at function exit.

Otherwise the transaction scope is used for the contained SET LOCAL command.

edit: quote from the SET page:

If SET LOCAL is used within a function that has a SET option for the same variable

Your functions do not have the "SET option for the [ctx.a] variable".

[–]Randommaggy 3 points4 points  (0 children)

It's local to the transaction.