SPI_GETTYPE(3)
β¨ 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 at1, not0β 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
- 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