Re: Additional SPI functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James William Pye <lists(at)jwp(dot)name>
Cc: PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Additional SPI functions
Date: 2009-12-20 07:03:14
Message-ID: 24086.1261292594@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

James William Pye <lists(at)jwp(dot)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 the other execution functions, the RPT loop plans and executes the statement before planning and executing the next in order to allow subsequent statements to see the effects of all the formers. The read only argument is "omitted" as it should only 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 store the information and supply constant parameters based on the identified parameter types, if need be. Also, if it returns rows, 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message James William Pye 2009-12-20 08:34:44 Re: Additional SPI functions
Previous Message James William Pye 2009-12-20 06:45:07 Additional SPI functions