matt@byrney.com writes:
> Thanks for this. Out of curiosity, why is a static a bad way to do this?
Well, it wouldn't allow more than one instance of the function per
query, and it wouldn't reset correctly after an error, and surely you
agree that your proposal of making the user do a separate "reset" step
is an unreliable and unpleasant-to-use kluge.
regards, tom lane