cursor vs. for _row in select...

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To: <pgsql-general(at)postgresql(dot)org>
Subject: cursor vs. for _row in select...
Date: 2008-02-05 10:28:34
Message-ID: 20080205112834.34280de5@webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Can somebody help me to appreciate the difference between returning a
setof record with cursor or with for _row in select ... as in

http://people.planetpostgresql.org/xzilla/index.php?/archives/149-out-parameter-sql-plpgsql-examples.html

Once I use and define cursors read only, no scroll, insensitive (that
should give enough information to use the cursor as a standard query)
I see there is an interesting advantage over for _row in select: you
don't have to specify the output type.

Is there any hidden penalty using cursor vs. for _row in select?

What's the meaning of:
"which can be used to retrieve a small number of rows at a time out
of a larger query".

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

Browse pgsql-general by date

  From Date Subject
Next Message Csaba Nagy 2008-02-05 11:16:05 Renaming a constraint
Previous Message Martijn van Oosterhout 2008-02-05 10:21:58 Re: Alternative to tableoids?