Re: Additional SPI functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Additional SPI functions
Дата
Msg-id 24086.1261292594@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Additional SPI functions  (James William Pye <lists@jwp.name>)
Ответы Re: Additional SPI functions  (James William Pye <lists@jwp.name>)
Re: Additional SPI functions  (James William Pye <lists@jwp.name>)
Список 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 по дате отправления:

Предыдущее
От: James William Pye
Дата:
Сообщение: Additional SPI functions
Следующее
От: James William Pye
Дата:
Сообщение: Re: Additional SPI functions