Re: Additional SPI functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Additional SPI functions
Date
Msg-id 24086.1261292594@sss.pgh.pa.us
Whole thread Raw
In response to Additional SPI functions  (James William Pye <lists@jwp.name>)
Responses Re: Additional SPI functions  (James William Pye <lists@jwp.name>)
Re: Additional SPI functions  (James William Pye <lists@jwp.name>)
List pgsql-hackers
James William Pye <lists@jwp.name> writes:
> extern int SPI_execute_statements(const char *src);

> Execute multiple statements. Intended, primarily, for executing one or more DDL or DML statements. In contrast with
theother execution functions, the RPT loop plans and executes the statement before planning and executing the next in
orderto allow subsequent statements to see the effects of all the formers. The read only argument is "omitted" as it
shouldonly be used in read-write cases(you can't read anything out of it).
 

This seems just about entirely useless.  Why not code a loop around one
of the existing SPI execution functions?

> extern SPIPlanPtr SPI_prepare_statement(
>  const char *src, int cursorOptions,
>  SPIParamCallback pcb, void *pcb_arg,
>  TupleDesc *resultDesc);

> Prepare a *single* statement and call the SPIParamCallback with the parameter information allowing the caller to
storethe information and supply constant parameters based on the identified parameter types, if need be. Also, if it
returnsrows, return the TupleDesc via *resultDesc.
 

This looks like it's most likely redundant with the stuff I added
recently for the plpgsql parser rewrite.  Please see if you can use that
instead.
        regards, tom lane


pgsql-hackers by date:

Previous
From: James William Pye
Date:
Subject: Additional SPI functions
Next
From: James William Pye
Date:
Subject: Re: Additional SPI functions