Re: How do I use the backend APIs

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Chad <chadzakary(at)hotmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How do I use the backend APIs
Date: 2006-02-23 16:39:41
Message-ID: 22883.1140712781@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
> On Tue, Feb 21, 2006 at 02:41:13AM -0800, Chad wrote:
>> -When rows change in between opening the cursor and fetching the
>> changed rows, will the FETCH retrieve the new data or is a snapshot
>> taken when the cursor is declared ?

> Standard visibility rules apply. READ COMMITTED shows anything
> committed, even after you've started. SERIALIZABLE gives you a
> consistant snapshot.

I believe that a cursor always shows a snapshot --- whether the
transaction is READ COMMITTED or SERIALIZABLE only affects whether
the snapshot is current as of the DECLARE CURSOR command or the
transaction's BEGIN command. In either case you won't see changes
occurring after the cursor is opened.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Henrique Reimer 2006-02-23 16:46:21 pg_dump warning with -Fc option
Previous Message Karsten Hilbert 2006-02-23 16:39:09 Re: How to specify infinity for intervals ?