.\\" auto-generated by docbook2man-spec $Revision: 1.1.1.1 $
.TH "SPI_fnumber" "" "2007-09-16" "" "PostgreSQL 7.4.18 Documentation"
.SH NAME
SPI_fnumber \- determine the column number for the specified column name

.SH SYNOPSIS
.sp
.nf
int SPI_fnumber(TupleDesc \fIrowdesc\fR, const char * \fIcolname\fR)
.sp
.fi
.SH "DESCRIPTION"
.PP
\fBSPI_fnumber\fR returns the column number for the
column with the specified name.
.PP
If \fIcolname\fR refers to a system column (e.g.,
oid) then the appropriate negative column number will
be returned. The caller should be careful to test the return value
for exact equality to \fBSPI_ERROR_NOATTRIBUTE\fR to
detect an error; testing the result for less than or equal to 0 is
not correct unless system columns should be rejected.
.SH "ARGUMENTS"
.TP
\fBTupleDesc \fIrowdesc\fB\fR
input row description
.TP
\fBconst char * \fIcolname\fB\fR
column name
.SH "RETURN VALUE"
.PP
Column number (count starts at 1), or
\fBSPI_ERROR_NOATTRIBUTE\fR if the named column was not
found.
