pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Stark <gsstark@mit.edu>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Richard Huxton <dev@archonet.com>
Cc: andrew@pillette.com
Cc: pgsql-sql@postgresql.org
Subject: Re: MOVE in SQL vs PLPGSQL
Date: 06 Oct 2005 16:39:11 -0400
Message-ID: <87u0fu5qj4.fsf@stark.xeocode.com> (raw)
In-Reply-To: <19176.1128526984@sss.pgh.pa.us>
References: <200510051417.j95EH0518161@pillette.com>
	<4343EABB.6030808@archonet.com>
	<19176.1128526984@sss.pgh.pa.us>

Tom Lane <tgl@sss.pgh.pa.us> writes:

> Richard Huxton <dev@archonet.com> writes:
> > Ah, now I see what you're saying. You're quite right in your suspicions, 
> > "MOVE..." isn't supported for plpgsql cursors. You could probably do 
> > something with EXECUTE and returning a refcursor from a previous 
> > function, but that sounds fiddly.
> 
> > I must admit, on the odd occasion I want to skip a row, I just FETCH it 
> > and move on. Anyone else?
> 
> There is something on the TODO list about improving plpgsql's cursor
> functionality --- there's no reason it shouldn't have MOVE, except that
> no one got around to it yet.

Though the original poster should realize, a MOVE command would be only
marginally more efficient than just fetching those records. It would save the
network overhead and context switches involved in communicating those records,
but there's no way it would let the server avoid reading all those records
from disk.

At least as far as I can see.

-- 
greg




view thread (5+ messages)

Message-ID: <87u0fu5qj4.fsf@stark.xeocode.com>
Permalink:  ../87u0fu5qj4.fsf@stark.xeocode.com/
Also on:    postgresql.org/message-id/87u0fu5qj4.fsf@stark.xeocode.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gsstark@mit.edu, tgl@sss.pgh.pa.us, dev@archonet.com, andrew@pillette.com
  Subject: Re: MOVE in SQL vs PLPGSQL
  In-Reply-To: <87u0fu5qj4.fsf@stark.xeocode.com>

* 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