---
name: "SPI_prepare_params"
section: "3"
platform: "linux"
package: "postgresql"
version: "18.6-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/SPI_prepare_params"
---

# SPI\_prepare\_params(3)

prepare a statement, without executing it yet

## NAME

SPI\_prepare\_params - prepare a statement, without executing it yet

## SYNOPSIS

```
SPIPlanPtr SPI_prepare_params(const char * command,
                              ParserSetupHook parserSetup,
                              void * parserSetupArg,
                              int cursorOptions)
```

## DESCRIPTION

**SPI\_prepare\_params** creates and returns a prepared statement for the specified command, but doesn't execute the command. This function is equivalent to **SPI\_prepare\_cursor**, with the addition that the caller can specify parser hook functions to control the parsing of external parameter references.

This function is now deprecated in favor of **SPI\_prepare\_extended**.

## ARGUMENTS

const char \* *command*

command string

ParserSetupHook *parserSetup*

Parser hook setup function

void \* *parserSetupArg*

pass-through argument for *parserSetup*

int *cursorOptions*

integer bit mask of cursor options; zero produces default behavior

## RETURN VALUE

**SPI\_prepare\_params** has the same return conventions as **SPI\_prepare**.
