Postgresql 中文操作指南

SPI_execute_plan_with_paramlist

SPI_execute_plan_with_paramlist — 执行由 SPI_prepare 准备的语句

SPI_execute_plan_with_paramlist — execute a statement prepared by SPI_prepare

Synopsis

int SPI_execute_plan_with_paramlist(SPIPlanPtr plan,
                                    ParamListInfo params,
                                    bool read_only,
                                    long count)

Description

SPI_execute_plan_with_paramlist 执行由 SPI_prepare 准备的语句。此函数等同于 SPI_execute_plan ,只是提供给查询传递的参数值的的信息存在差异。 ParamListInfo 表示可以通过便捷的方式传递已以该格式显示的值。它还支持通过 ParamListInfo 中指定挂接式函数使用动态参数集。

SPI_execute_plan_with_paramlist executes a statement prepared by SPI_prepare. This function is equivalent to SPI_execute_plan except that information about the parameter values to be passed to the query is presented differently. The ParamListInfo representation can be convenient for passing down values that are already available in that format. It also supports use of dynamic parameter sets via hook functions specified in ParamListInfo.

此函数现已弃用,原因是赞成使用 SPI_execute_plan_extended

This function is now deprecated in favor of SPI_execute_plan_extended.

Arguments

  • SPIPlanPtr _plan_

    • prepared statement (returned by SPI_prepare)

  • ParamListInfo _params_

    • data structure containing parameter types and values; NULL if none

  • bool _read_only_

    • true for read-only execution

  • long _count_

    • maximum number of rows to return, or 0 for no limit

Return Value

返回值同 SPI_execute_plan

The return value is the same as for SPI_execute_plan.

如果成功,则 SPI_processedSPI_tuptable 会像 SPI_execute_plan 中那样设置。

SPI_processed and SPI_tuptable are set as in SPI_execute_plan if successful.