erm, you're right (re-tested that today)
I don't know what happened the other day. The query updating the flag
would not return until the test function was done.
I must have made the test duration too short, so that it was only appearances.
whatever, it works. thanks.

WBL

On Wed, Jul 6, 2011 at 2:36 PM, hubert depesz lubaczewski
<dep...@depesz.com> wrote:
> On Wed, Jul 06, 2011 at 12:54:21PM +0200, Willy-Bas Loos wrote:
>> I'd like to do a dirty read from plpgsql, so that i can stop the function
>> that is in a long loop without rolling back the work that it did.
>> All i want to read is a flag that says 'stop'.
>
> this doesn't need dirty read.
> just read committed.
> make table with flags, and insert there row which says "stop". make sure
> the insert gets committed.
>
> every so often, in your function check flags in the table, and since the
> change got committed - it will be visible, and function will stop.
>
> Best regards,
>
> depesz
>
> --
> The best thing about modern society is how easy it is to avoid contact with 
> it.
>                                                             http://depesz.com/
>



-- 
"Patriotism is the conviction that your country is superior to all
others because you were born in it." -- George Bernard Shaw

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to