Accessing Database Data from C Function

Поиск
Список
Период
Сортировка
От jeffrey.bigham@gmail.com
Тема Accessing Database Data from C Function
Дата
Msg-id 1155064578.473986.228960@b28g2000cwb.googlegroups.com
обсуждение исходный текст
Ответы Re: Accessing Database Data from C Function
Список pgsql-general
Hello,

I'd like to write a C Function for Postgresql that can access data in
the database, use that to conduct additional queries to find more
information in the database and eventually return a result.  I
currently have the functionality I want implemented as php/C programs
that first connect to the database, do the processing and then
disconnect, but I want to make it what I think is called a "stored
procedure" in other databases.  It seems odd that I would write a C
program to be included in the database that connects to  the localhost
- is that what I should do?  Is that somehow more efficient than
running it as a separate process?

I've looked into C Functions but the examples I've found have talked
about performing calculations on the arguments.  Table function
examples show how I might return more than one row or multi-columned
rows, but I don't see how to actually access the data in the database.

I apologize if this question is answered somewhere.  I suspect it is
but I apparently don't know the terminology to look it up and have
spent an hour conducting fruitless Google searches.  A pointer to such
a resource along with the topic I should check out would be more than
helpful.

Thanks,
Jeff


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

Предыдущее
От: gpap@ifrance.com
Дата:
Сообщение: sizing of a server
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Does DROP TABLE free up disk space immediately?