SPI_GETARGTYPEID(3)
β¨ NAME β¨
okay bestie, welcome to SPI_GETARGTYPEID(3) β straight out of the PostgreSQL 14.24 Documentation! This one is all about SPI_getargtypeid, aka the function that returns the data type OID for an argument of a statement prepared by SPI_prepare. π
β¨ SYNOPSIS β¨
Oid SPI_getargtypeid(SPIPlanPtr plan, int argIndex)
β¨ DESCRIPTION β¨
So SPI_getargtypeid returns the OID representing the type for the argIndex'th argument of a statement prepared by SPI_prepare. And bestie, indexing starts at zero β the first argument is at index zero. Periodt. π
β¨ ARGUMENTS β¨
SPIPlanPtr planβ the prepared statement, aka the one returned bySPI_prepareβ¨int argIndexβ the zero based index of the argument π
β¨ RETURN VALUE β¨
It returns the type OID of the argument at the given index. π
but lowkey watch out: if the plan isNULLor invalid, orargIndexis less than 0 or not less than the number of arguments declared for the plan, thenSPI_resultis set toSPI_ERROR_ARGUMENTandInvalidOidis returned. no cap, that's the whole caveat. π
xoxo, from the PostgreSQL 14.24 docs, dated 2026 β slay and happy hacking π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: postgresql14-docs 14.24-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