]> begriffs open source - ai-pg/blob - full-docs/src/sgml/man3/SPI_fnumber.3
WIP: toc builder
[ai-pg] / full-docs / src / sgml / man3 / SPI_fnumber.3
1 '\" t
2 .\"     Title: SPI_fnumber
3 .\"    Author: The PostgreSQL Global Development Group
4 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
5 .\"      Date: 2025
6 .\"    Manual: PostgreSQL 18.0 Documentation
7 .\"    Source: PostgreSQL 18.0
8 .\"  Language: English
9 .\"
10 .TH "SPI_FNUMBER" "3" "2025" "PostgreSQL 18.0" "PostgreSQL 18.0 Documentation"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 SPI_fnumber \- determine the column number for the specified column name
32 .SH "SYNOPSIS"
33 .sp
34 .nf
35 int SPI_fnumber(TupleDesc \fIrowdesc\fR, const char * \fIcolname\fR)
36 .fi
37 .SH "DESCRIPTION"
38 .PP
39 \fBSPI_fnumber\fR
40 returns the column number for the column with the specified name\&.
41 .PP
42 If
43 \fIcolname\fR
44 refers to a system column (e\&.g\&.,
45 ctid) then the appropriate negative column number will be returned\&. The caller should be careful to test the return value for exact equality to
46 SPI_ERROR_NOATTRIBUTE
47 to detect an error; testing the result for less than or equal to 0 is not correct unless system columns should be rejected\&.
48 .SH "ARGUMENTS"
49 .PP
50 TupleDesc \fIrowdesc\fR
51 .RS 4
52 input row description
53 .RE
54 .PP
55 const char * \fIcolname\fR
56 .RS 4
57 column name
58 .RE
59 .SH "RETURN VALUE"
60 .PP
61 Column number (count starts at 1 for user\-defined columns), or
62 SPI_ERROR_NOATTRIBUTE
63 if the named column was not found\&.