PostgreSQL

PostgreSQL Elephant Logo

SPI_prepare_extended

SPI_prepare_extended — prepare a statement, without executing it yet

Synopsis

SPIPlanPtr SPI_prepare_extended(const char * command,
                                const SPIPrepareOptions * options)

Description

SPI_prepare_extended creates and returns a prepared statement for the specified command, but doesn’t execute the command. This function is equivalent to SPI_prepare, with the addition that the caller can specify options to control the parsing of external parameter references, as well as other facets of query parsing and planning.

Arguments

`const char * +`_`+command`_

command string

`const SPIPrepareOptions * +`_`+options`_

struct containing optional arguments

Callers should always zero out the entire `options struct, then fill whichever fields they want to set. This ensures forward compatibility of code, since any fields that are added to the struct in future will be defined to behave backwards-compatibly if they are zero. The currently available options` fields are:

`ParserSetupHook +`_`+parserSetup`_

Parser hook setup function

`void * +`_`+parserSetupArg`_

pass-through argument for `parserSetup`

`RawParseMode +`_`+parseMode`_

mode for raw parsing; RAW_PARSE_DEFAULT (zero) produces default behavior

`int +`_`+cursorOptions`_

integer bit mask of cursor options; zero produces default behavior

Return Value

SPI_prepare_extended has the same return conventions as SPI_prepare.


Prev Up Next

SPI_prepare_cursor

Home

SPI_prepare_params

Submit correction

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.

Copyright © 1996-2023 The PostgreSQL Global Development Group