Re: How do I use the backend APIs

From: Alban Hertroys <alban(at)magproductions(dot)nl>
To: Chad <chadzakary(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How do I use the backend APIs
Date: 2006-02-20 10:24:02
Message-ID: 43F998C2.9090400@magproductions.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)magproductions(dot)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 //

In response to

Browse pgsql-general by date

  From Date Subject
Next Message lists 2006-02-20 10:37:49 What is the syntax for setting a default date in PostgreSQL
Previous Message Peter Eisentraut 2006-02-20 09:02:04 Re: Encodings