1SPI_MODIFYTUPLE(3) PostgreSQL 9.2.24 Documentation SPI_MODIFYTUPLE(3)
2
3
4
6 SPI_modifytuple - create a row by replacing selected fields of a given
7 row
8
10 HeapTuple SPI_modifytuple(Relation rel, HeapTuple row, int ncols,
11 int * colnum, Datum * values, const char * nulls)
12
14 SPI_modifytuple creates a new row by substituting new values for
15 selected columns, copying the original row's columns at other
16 positions. The input row is not modified.
17
19 Relation rel
20 Used only as the source of the row descriptor for the row. (Passing
21 a relation rather than a row descriptor is a misfeature.)
22
23 HeapTuple row
24 row to be modified
25
26 int ncols
27 number of column numbers in the array colnum
28
29 int * colnum
30 array of the numbers of the columns that are to be changed (column
31 numbers start at 1)
32
33 Datum * values
34 new values for the specified columns
35
36 const char * Nulls
37 which new values are null, if any (see SPI_execute_plan for the
38 format)
39
41 new row with modifications, allocated in the upper executor context;
42 NULL only if row is NULL
43
44 On error, SPI_result is set as follows:
45
46 SPI_ERROR_ARGUMENT
47 if rel is NULL, or if row is NULL, or if ncols is less than or
48 equal to 0, or if colnum is NULL, or if values is NULL.
49
50 SPI_ERROR_NOATTRIBUTE
51 if colnum contains an invalid column number (less than or equal to
52 0 or greater than the number of column in row)
53
54
55
56PostgreSQL 9.2.24 2017-11-06 SPI_MODIFYTUPLE(3)