Thread: Executing an SQL query from an internal function...

Executing an SQL query from an internal function...

From
"Redefined Horizons"
Date:
If I am implementing an internal function in PostgreSQL with the C
programming language, can I use one of the C API's to execute a query
from within the function? Is there another way to execute an SQL query
from within an internal function implemented in C?

Thanks,

Scott Huey

Re: Executing an SQL query from an internal function...

From
Alvaro Herrera
Date:
Redefined Horizons wrote:
> If I am implementing an internal function in PostgreSQL with the C
> programming language, can I use one of the C API's to execute a query
> from within the function? Is there another way to execute an SQL query
> from within an internal function implemented in C?

The SPI interface is designed to do that.

http://www.postgresql.org/docs/8.1/static/spi.html

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.