Re: How do I use the backend APIs

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: How do I use the backend APIs
Дата
Msg-id 20060217092104.GB9254@svana.org
обсуждение исходный текст
Ответ на How do I use the backend APIs  ("Chad" <chadzakary@hotmail.com>)
Ответы Re: How do I use the backend APIs  ("Chad" <chadzakary@hotmail.com>)
Список pgsql-general
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@svana.org>   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.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: "Dave Page"
Дата:
Сообщение: Re: Problem with postgres installation
Следующее
От: David Goodenough
Дата:
Сообщение: Implicit conversion from string to timestamp