SPI_GETTYPE(3)

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

✨ NAME ✨

okay so welcome to SPI_gettype, bestie β€” this is the PostgreSQL 14.24 Documentation page for it, section 3 (SPI_GETTYPE(3), iykyk), and its whole thing is literally to return the data type name of the specified column. no cap, that's the assignment. πŸ’…

🌸 SYNOPSIS 🌸

char * SPI_gettype(TupleDesc rowdesc, int colnumber)

πŸ¦‹ DESCRIPTION πŸ¦‹

SPI_gettype hands you a copy of the data type name for the column you picked. that's it, that's the tea. β˜• when you're done with the copy of the name and don't need it anymore, you can use pfree to release it. (yes bestie, free your memory, it's giving responsible icon behavior. πŸ’–)

πŸŽ€ ARGUMENTS πŸŽ€

  • TupleDesc rowdesc β€” the input row description, aka the row's little info card. πŸͺͺ
  • int colnumber β€” the column number. count starts at 1, not 0 β€” that's the rule, fr fr. πŸ”’

πŸ‘‘ RETURN VALUE πŸ‘‘

you get the data type name of the specified column, or NULL on error. 😭 and on error, SPI_result is set to SPI_ERROR_NOATTRIBUTE β€” that's the exact code, periodt.


πŸ’– later, bestie β€” this page is from PostgreSQL 14.24, dated 2026. mwah! πŸ’–

πŸ“¦ where this page comes from