September 26, 2024: PostgreSQL 17 Released!
Unsupported versions: 7.3 / 7.2 / 7.1
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead.

SPI_fname

Name

SPI_fname -- Finds the attribute name for the specified attribute number

Synopsis

SPI_fname(tupdesc, fnumber)

Inputs

TupleDesc tupdesc

Input tuple description

int fnumber

Attribute number

Outputs

char *

Attribute name

NULL if fnumber is out of range
SPI_result set to SPI_ERROR_NOATTRIBUTE on error

Description

SPI_fname returns the attribute name for the specified attribute.

Usage

Attribute numbers are 1 based.

Algorithm

Returns a newly-allocated copy of the attribute name. (Use pfree() to release the copy when done with it.)