PostgreSQL Programmer's Guide
PrevNext

SPI_execp

Name

SPI_execp — SPI_saveplanが準備、あるいは返したプランを実行する

SPI_execp(plan,
values,
nulls,
tcount)

入力

void *plan

実行プラン

Datum *values

実際のパラメータ値

char *nulls

パラメータが NULL を許すかどうかを表す配列

'n' は NULL を許すことを示す
' ' は NULL を許さないことを示す

int tcount

プランが実行対象とするタプルの数

Outputs

int

SPI_exec が返却するのと同様の値に加え、以下を返し ます

もしもplanが NULLか、tcount < 0 なら SPI_ERROR_ARGUMENTを返す
SPI_ERROR_PARAM もしもvaluesが NULL かつ plan に引数があるなら SPI_ERROR_PARAM を返す

SPI_tuptable

成功すれば SPI_exec と同じように 初期化されます

SPI_processed

成功すれば SPI_exec と同じように 初期化されます

説明

[訳注: 明らかにここの説明は SPI_execp のためのものではないようなのですが...] SPI_execp stores a plan prepared by SPI_prepare in safe memory protected from freeing by SPI_finish or the transaction manager.

In the current version of Postgres there is no ability to store prepared plans in the system catalog and fetch them from there for execution. This will be implemented in future versions. As a work arround, there is the ability to reuse prepared plans in the consequent invocations of your procedure in the current session. Use SPI_execp to execute this saved plan.

使い方

If nulls is NULL then SPI_execp assumes that all values (if any) are NOT NULL.

NOTE: If one of the objects (a relation, function, etc.) referenced by the prepared plan is dropped during your session (by your backend or another process) then the results of SPI_execp for this plan will be unpredictable.


PrevHomeNext
SPI_saveplanUpインターフェイス補助関数