SPI_fnumber <refpurpose>determine the column number for the specified column name</refpurpose> — 指定した列名から列番号を決定する
int SPI_fnumber(TupleDescrowdesc, const char *colname)
<function>SPI_fnumber</function> returns the column number for the
column with the specified name.
SPI_fnumberは指定した名前の列の列番号を返します。
If <parameter>colname</parameter> refers to a system column (e.g.,
<literal>ctid</literal>) then the appropriate negative column number will
be returned. The caller should be careful to test the return value
for exact equality to <symbol>SPI_ERROR_NOATTRIBUTE</symbol> to
detect an error; testing the result for less than or equal to 0 is
not correct unless system columns should be rejected.
colnameが(ctidなどの)システム列を参照する場合、適切な負の列番号が返されます。
呼び出し元は、エラーを検知するために戻り値がSPI_ERROR_NOATTRIBUTEと正確に同一であるかどうかを注意して検査しなければなりません。
システム列を拒絶させたくなければ、結果が0あるいは0未満かを検査するという方法は、正しくありません。
TupleDesc rowdescinput row description 入力行の記述
const char * colnamecolumn name 列名
Column number (count starts at 1 for user-defined columns), or
<symbol>SPI_ERROR_NOATTRIBUTE</symbol> if the named column was not
found.
(ユーザ定義の列について1から始まる)列番号。
指定された名前の列が見つからなければ、SPI_ERROR_NOATTRIBUTEです。