[pgrouting-dev] Re: pgrouting-dev Digest, Vol 11, Issue 6

Hi Daniel,

thank you for your reply. Why does pgRouting not contain a wrapper
function like yours or mine?
Surly most users would be interested in this kind of functionality.

I've taken a look at your github repo, there is a lot of code in this
project but I do not see the solution to my problem.

You seem to be very familiar with plpgsql, can you tell me, how do I
extract the first and last item in a record set?

Cathal

On Wed, Apr 13, 2011 at 12:11 PM, cathal coffey <coffey.cathal@gmail.com> wrote:

how do I
extract the first and last item in a record set?

you mean a cursor inside plpgsql?

FETCH FIRST FROM cursor_name INTO some_var;
FETCH LAST FROM cursor name INTO some_var;

now the question is why aren't you using min() and max() in a select?

--
Jaime Casanova www.2ndQuadrant.com
Professional PostgreSQL: Soporte y capacitaciĆ³n de PostgreSQL