SPI_GETTYPEID(3)

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

πŸ’… NAME πŸ’…

okay so bestie, welcome to SPI_GETTYPEID(3) from the PostgreSQL 16.15 Documentation β€” this one is literally about SPI_gettypeid, the function that returns the data type OID of the specified column. πŸ‘‘βœ¨

✨ SYNOPSIS ✨

Oid SPI_gettypeid(TupleDesc rowdesc, int colnumber)

πŸ¦‹ DESCRIPTION πŸ¦‹

SPI_gettypeid returns the OID of the data type of the specified column. That's it, that's the whole serve: you give it a column, it hands back the data type's OID. no cap. πŸ’…

πŸŽ€ ARGUMENTS πŸŽ€

  • TupleDesc rowdesc β€” the input row description, aka the row descriptor you're passing in. 🫢
  • int colnumber β€” the column number. and yes, the count starts at 1 β€” not 0, bestie. iykyk. πŸ’–

πŸ’– RETURN VALUE πŸ’–

It returns the OID of the data type of the specified column, or InvalidOid on error. 😭

On error, SPI_result is set to SPI_ERROR_NOATTRIBUTE. that's what gets set, fr fr. 🚩

mwah πŸ’‹ β€” this has been SPI_GETTYPEID(3) from PostgreSQL 16.15, dated 2026. now go slay those columns, bestie. πŸŒˆπŸ‘‘πŸŽ€

πŸ“¦ where this page comes from