Cursors

From: Andy Chambers <achambers(at)mcna(dot)net>
To: pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Cursors
Date: 2011-06-15 04:54:05
Message-ID: BANLkTik76pR5vb6JxnCKkzqCRN9OL-ADwA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

What happens to cursors when new data is added to a table after you
start iterating
over its rows?

For example, given the following loop...

for rule in select tc.sid, tc.s, td.rule, td.returns
from tcell tc
inner join tcelldef td on (tc.p = td.p)
where tc.iasid = current_audit_sid()
or committed_sid in ( select committed
from tcellread tcr
where tc.sid = tcr.tcell )
for update of tc loop
...
end loop;

some code in the loop might add a record into tcellread that causes the where
condition to become true for a row in which it was previously false.
Will the cursor
eventually see it?

Thanks,
Andy

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Manuel Gysin 2011-06-15 06:07:35 Encryption For Specific Column- Where to store the key
Previous Message Josh Kupershmidt 2011-06-15 02:35:45 Re: Executing \i of psql command using libpq library