Re: How do I use the backend APIs - Mailing list pgsql-general

From Alban Hertroys
Subject Re: How do I use the backend APIs
Date
Msg-id 43F998C2.9090400@magproductions.nl
Whole thread Raw
In response to Re: How do I use the backend APIs  ("Chad" <chadzakary@hotmail.com>)
List pgsql-general
Chad wrote:
> Thanks Martijn,

> "Well, in the backend you can do things like open a btree index, setup
> an ScanKey to indicate which values you want and then keep calling
> getnext(). If you set your scankey to (col1 >= 'A') it will start at
> 'A' and go up from there... "

That looks suspiciously much like cursors. Isn't this what you're
looking for?:

OPEN curs1 FOR SELECT * FROM foo WHERE key = mykey;
FETCH cursor INTO target;
CLOSE cursor;

(from:
http://www.postgresql.org/docs/8.1/static/plpgsql-cursors.html#PLPGSQL-CURSOR-DECLARATIONS
)

I figure the other PL/ languages feature cursors as well, but I've never
used those.

--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Encodings
Next
From: Andreas Seltenreich
Date:
Subject: Re: simple explain output.