Postgresql 中文操作指南

SPI_fname

SPI_fname — 确定指定列号的列名

SPI_fname — determine the column name for the specified column number

Synopsis

char * SPI_fname(TupleDesc rowdesc, int colnumber)

Description

SPI_fname 返回指定列的列名副本。(如果不再需要该名称的副本,可以使用 pfree 来释放该名称。)

SPI_fname returns a copy of the column name of the specified column. (You can use pfree to release the copy of the name when you don’t need it anymore.)

Arguments

  • TupleDesc _rowdesc_

    • input row description

  • int _colnumber_

    • column number (count starts at 1)

Return Value

列名;如果 colnumber 超出范围,则为 NULL 。如果出错,则 SPI_result 设置为 SPI_ERROR_NOATTRIBUTE

The column name; NULL if colnumber is out of range. SPI_result set to SPI_ERROR_NOATTRIBUTE on error.