pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannu Krosing <hannu@tm.ee>
To: Hiroshi Inoue <inoue@tpf.co.jp>
Cc: 'Tom Lane' <tgl@sss.pgh.pa.us>
Cc: 'Peter Eisentraut' <peter_e@gmx.net>
Cc: 'Bruce Momjian' <pgman@candle.pha.pa.us>
Cc: 'Neil Conway' <neilc@samurai.com>
Cc: 'PostgreSQL Hackers' <pgsql-hackers@postgresql.org>
Subject: Re: updateable cursors & visibility
Date: 31 Mar 2003 19:43:29 +0300
Message-ID: <1049129009.1842.55.camel@fuji.krosing.net> (raw)
In-Reply-To: <001601c2f79f$d2eb1e40$0e283ddb@PbgX>
References: <001601c2f79f$d2eb1e40$0e283ddb@PbgX>

Hiroshi Inoue kirjutas E, 31.03.2003 kell 19:08:
> > -----Original Message-----
> > From: Hannu Krosing [mailto:hannu@tm.ee] 
> > 
> > Hiroshi Inoue kirjutas E, 31.03.2003 kell 03:40:
> > 
> > > 2) dynamic
> > >    It can detect any changes made to the membership, order,
> > >    and values of the result set after the cursor is opened.
> > 
> > What would it mean in practice, i.e. if you are on the first 
> > row in the
> > cursor and then update tha ORDER BY field so that your row becomes the
> > last one, will the next FETCH move the cursor past end ?
> 
> No. The row next to the old first row would be FETCHed.

In what way would the _changes_made_to_the_order_ be reflected then ?
 
> > what happens, if the row you are on is removed from the keyset, either
> > by current or any other backend ?
> 
> The dynamic cursor doesn't see the row any longer.

It seems to be doable with MVCC - "just" ;) check for visibility of
underlying tuples at each fetch. At least it does not seem any harder
for MVCC than for other CC methods.

>  
> > > 3) keyset-driven
> > >    It always detects changes to the values of rows.
> > 
> > What about _new_ rows, 
> 
> It never detects new rows. 

Then I must have misunderstood the "can detect any changes made to the
membership, order, and values" part. I assumed that "any changes" wold
also include rows that magically become part of the query by either
changes in values or being inserted.

> > or rows that no more belong to the "keyset" ?
> 
> They are the same as deleted ones. 

So they are no more visible to cursor ?

> > >From your short description it is not even clear for me how *exactly*
> > should they behave.
> 
> I only intended to illustrate various type of visibilities roughly
> because
> there were no such reference in this thread.
> 
> regards,
> Hiroshi Inoue
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org




view thread (34+ messages)  latest in thread

Message-ID: <1049129009.1842.55.camel@fuji.krosing.net>
Permalink:  ../1049129009.1842.55.camel@fuji.krosing.net/
Also on:    postgresql.org/message-id/1049129009.1842.55.camel@fuji.krosing.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: hannu@tm.ee, inoue@tpf.co.jp, tgl@sss.pgh.pa.us, peter_e@gmx.net, pgman@candle.pha.pa.us, neilc@samurai.com
  Subject: Re: updateable cursors & visibility
  In-Reply-To: <1049129009.1842.55.camel@fuji.krosing.net>
  References: <001601c2f79f$d2eb1e40$0e283ddb@PbgX> <1049129009.1842.55.camel@fuji.krosing.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox