Search Postgresql Archives

Re: dirty read from plpgsql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux