Search Postgresql Archives

Re: How do I use the backend APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 16, 2006 at 07:41:09AM -0800, Chad wrote:
> Hi,
> 
> In Postgres, is there a C language API which would give me access to
> BTrees like Berkeley DB does? eg to seek to a particular key/value pair
> and iterate forward from there? If not whats the nearest thing to this
> in Postgres?

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...

Most of the time though you just create a query and use SPI_exec. Then
you don't actually have to worry about details like names of the
indexes, OIDs, types, comparison functions, etc...

Have a nice day,
-- 
Martijn van Oosterhout   <kleptog@xxxxxxxxx>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux