Re: SPI_prepare's parameter

From: "Albe Laurenz" <laurenz(dot)albe(at)wien(dot)gv(dot)at>
To: 高健 *EXTERN* <luckyjackgao(at)gmail(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: SPI_prepare's parameter
Date: 2012-10-29 11:14:30
Message-ID: D960CB61B694CF459DCFB4B0128514C2089A5EF8@exadv11.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

高健 wrote:
> I am new to PostgreSQL's SPI(Server Programming Interface).
>
> I can understand PostgreSQL's exampel of using SPI. But I am not sure about SPI_prepare's parameter.
>
> void * SPI_prepare(const char * command, int nargs, Oid * argtypes)
>
>
> Can somebody kindly give an example of using SPI_prepare ?

Untested:

Oid types[] = { INT4OID };
SPIPlanPtr planptr = SPI_prepare("SELECT val FROM tab WHERE id = $1", 1, types);

Yours,
Laurenz Albe

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2012-10-29 11:44:08 Re: oracle_fdw with oracle os authentication
Previous Message Chris Angelico 2012-10-29 11:00:05 Re: How to print application_name in log_line_prefix (using %a)?