SPI_GETARGTYPEID(3)

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

okay so welcome to SPI_GETARGTYPEID(3), bestie β€” this is one of those little PostgreSQL 17.11 documentation pages, and it's lowkey a tiny helper. Let's get into it πŸ’…

πŸ’– NAME πŸ’–

SPI_getargtypeid β€” return the data type OID for an argument of a statement prepared by SPI_prepare

✨ SYNOPSIS ✨

Oid SPI_getargtypeid(SPIPlanPtr plan, int argIndex)

πŸ¦‹ DESCRIPTION πŸ¦‹

SPI_getargtypeid returns the OID representing the type for the argIndex'th argument of a statement prepared by SPI_prepare. First argument is at index zero. No cap, zero-based indexing is the main character here πŸŽ€

🌸 ARGUMENTS 🌸

  • SPIPlanPtr plan β€” the prepared statement, returned by SPI_prepare
  • int argIndex β€” the zero based index of the argument

πŸ’œ RETURN VALUE πŸ’œ

The type OID of the argument at the given index.

but bestie, watch out: if the plan is NULL or invalid, or argIndex is less than 0 or not less than the number of arguments declared for the plan, SPI_result is set to SPI_ERROR_ARGUMENT and InvalidOid is returned πŸ’€

signing off from the PostgreSQL 17.11 docs, dated 2026, on the SPI_GETARGTYPEID(3) page β€” slay and read your manpages responsibly 🫢✨

πŸ“¦ where this page comes from