SPI_GETARGTYPEID(3)
π 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 bySPI_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
- opensuse-leap 16.0: postgresql15-docs 15.19-160000.1.1 Β· PostgreSQL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms