SPI_GETTYPEID(3)

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

✨ NAME ✨

SPI_gettypeid β€” bestie, this is the SPI_GETTYPEID(3) page, and it does exactly one iconic thing: it returns the data type OID of the specified column. No cap, that's the whole vibe.

🌸 SYNOPSIS 🌸

Oid SPI_gettypeid(TupleDesc rowdesc, int colnumber)

πŸ’– DESCRIPTION πŸ’–

Okay so SPI_gettypeid literally returns the OID of the data type of the specified column. That's it. It's giving "small function, clear purpose," and we love that for us. πŸ’…

πŸŽ€ ARGUMENTS πŸŽ€

  • TupleDesc rowdesc β€” the input row description, aka the row info you're handing over. 🫢
  • int colnumber β€” the column number. Heads up bestie: the count starts at 1, not 0. Fr fr. πŸ™ˆ

πŸ”₯ RETURN VALUE πŸ”₯

You get 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 the fail state, and now you know exactly what it means. πŸ’€


That's the whole page, bestie β€” source/version: PostgreSQL 14.24 Documentation, date: 2026. Slay and stay type-safe. πŸ‘‘βœ¨

πŸ“¦ where this page comes from