Re: Maintaining state across function calls

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: matt(at)byrney(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Maintaining state across function calls
Date: 2012-11-19 19:37:22
Message-ID: 10942.1353353842@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

matt(at)byrney(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Ross 2012-11-19 19:49:17 Split_part on a CR
Previous Message Welty, Richard 2012-11-19 19:19:57 Re: Experiences with pl/Java