SetQuerySnapshot inside PL/PGSQL ? - Mailing list pgsql-general

From D. Dante Lorenso
Subject SetQuerySnapshot inside PL/PGSQL ?
Date
Msg-id 005801c31abc$4b3eb340$1564a8c0@ROMULUS
Whole thread Raw
In response to Re: Serialization, Locking...implement processing Queue with a table  ("D. Dante Lorenso" <dante@lorenso.com>)
List pgsql-general
I really want to see newly committed data when I am INSIDE
a PL/PGSQL function.  This way, if I do a LOCK on a table
and subsequently perform a SELECT after aquiring the lock,
I know I'll see the data that any previous transactions just
updated (hence they released my lock)...

So, if you don't want to do the auto 'SetQuerySnapshot' calls
as they probably should be, is there a way I can call this from
the PL/PGSQL function myself, directly?  Something like this:

-------------------- 8< --------------------
CREATE OR REPLACE...
...
BEGIN
    LOCK TABLE blah_blah... EXCLUSIVE MODE;
    SetQuerySnapshot();  <----------- I want something like this

    SELECT id
    FROM table
    WHERE blah blah blah ...
    FOR UPDATE;

    IF NOT FOUND THEN
        ...
    ELSE
        ...
    END IF;
END;
...
-------------------- 8< --------------------

Something like that might solve my problem whereby I'd like the
PL/pgSQL function to be able to work as if it were in READ COMMITTED
mode.

Dante

D. Dante Lorenso
dante@lorenso.com
972-333-4139



pgsql-general by date:

Previous
From: "D. Dante Lorenso"
Date:
Subject: Re: Serialization, Locking...implement processing Queue with a table
Next
From: Ewald Geschwinde
Date:
Subject: problem