SPI_PREPARE_EXTENDED(3)

πŸ“¦ version 17.11, in opensuse-leap 16.0

πŸ’– NAME πŸ’–

SPI_prepare_extended β€” prepare a statement, without executing it yet.

This is the SPI_PREPARE_EXTENDED(3) page, bestie, and it's lowkey iconic. πŸ¦‹

✨ SYNOPSIS ✨

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

🌸 DESCRIPTION 🌸

okay so SPI_prepare_extended creates and returns a prepared statement for the specified command, but β€” important β€” it doesn't execute the command. It's 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. So it's giving "prep era, not performance era." πŸ’…

πŸŽ€ ARGUMENTS πŸŽ€

  • const char * command β€” command string.
  • const SPIPrepareOptions * options β€” struct containing optional arguments.
bestie, listen: 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. no cap.

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. that's it, that's the vibe β€” same return conventions, no extra lore. 🫢


Source/version and date check: PostgreSQL 17.11, dated 2026 β€” that's the footer vibe, and we're obsessed. πŸ’œ

πŸ“¦ where this page comes from