Postgresql 中文操作指南

SPI_getbinval

SPI_getbinval - 返回指定列的二进制值

SPI_getbinval — return the binary value of the specified column

Synopsis

Datum SPI_getbinval(HeapTuple row, TupleDesc rowdesc, int colnumber,
                    bool * isnull)

Description

SPI_getbinval 以内部形式(作为类型 Datum )返回指定列的值。

SPI_getbinval returns the value of the specified column in the internal form (as type Datum).

此函数不会为数据集分配新的空间。对于按引用传递的数据类型,返回值将是传递的行中的指针。

This function does not allocate new space for the datum. In the case of a pass-by-reference data type, the return value will be a pointer into the passed row.

Arguments

  • HeapTuple _row_

    • input row to be examined

  • TupleDesc _rowdesc_

    • input row description

  • int _colnumber_

    • column number (count starts at 1)

  • bool * _isnull_

    • flag for a null value in the column

Return Value

返回列的二进制值。如果该列为 null,则 isnull 指向的变量将设置为 true,否则将设置为 false。

The binary value of the column is returned. The variable pointed to by isnull is set to true if the column is null, else to false.

出错时,将 SPI_result 设置为 SPI_ERROR_NOATTRIBUTE

SPI_result is set to SPI_ERROR_NOATTRIBUTE on error.