SPI_GETARGTYPEID(3)

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

πŸ’– NAME

Okay so bestie, this is SPI_GETARGTYPEID(3) β€” the PostgreSQL helper that returns the data type OID for an argument of a statement prepared by SPI_prepare. It’s giving β€œtype detective” energy, fr fr. πŸŽ€

✨ 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 β€” yes bestie, zero-based indexing is the main character here, periodt. ✨

🌸 ARGUMENTS

  • SPIPlanPtr plan β€” the prepared statement (returned by SPI_prepare). This is the vibe check target, iykyk. πŸ’…
  • int argIndex β€” zero based index of the argument. Not one based, bestie β€” zero based. πŸ™ˆ

πŸ‘‘ RETURN VALUE

The type OID of the argument at the given index. Easy, iconic. But if plan is NULL or invalid, or argIndex is less than 0 or not less than the number of arguments declared for the plan, then SPI_result is set to SPI_ERROR_ARGUMENT and InvalidOid is returned. Not me getting an error case β€” handle it, bestie. 😭


Cute sign-off: this page is from the PostgreSQL 15.19 docs, dated 2026. Hope that slayed for you, bestie β€” mwah πŸ’‹

πŸ“¦ where this page comes from