GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SPI_MODIFYTUPLE (3)

.ds Aq ’

NAME

SPI_modifytuple - create a row by replacing selected fields of a given row

CONTENTS

SYNOPSIS

HeapTuple SPI_modifytuple(Relation rel, HeapTuple row, int ncols,
                          int * colnum, Datum * values, const char * nulls)

DESCRIPTION

SPI_modifytuple creates a new row by substituting new values for selected columns, copying the original rows columns at other positions. The input row is not modified.

ARGUMENTS

Relation rel

Used only as the source of the row descriptor for the row. (Passing a relation rather than a row descriptor is a misfeature.)

HeapTuple row

row to be modified

int ncols

number of columns to be changed

int * colnum

an array of length ncols, containing the numbers of the columns that are to be changed (column numbers start at 1)

Datum * values

an array of length ncols, containing the new values for the specified columns

const char * nulls

an array of length ncols, describing which new values are null

If nulls is NULL then SPI_modifytuple assumes that no new values are null. Otherwise, each entry of the nulls array should be if the corresponding new value is non-null, or n if the corresponding new value is null. (In the latter case, the actual value in the corresponding values entry doesnt matter.) Note that nulls is not a text string, just an array: it does not need a \0 terminator.

RETURN VALUE

new row with modifications, allocated in the upper executor context; NULL only if row is NULL

On error, SPI_result is set as follows:

SPI_ERROR_ARGUMENT

if rel is NULL, or if row is NULL, or if ncols is less than or equal to 0, or if colnum is NULL, or if values is NULL.

SPI_ERROR_NOATTRIBUTE

if colnum contains an invalid column number (less than or equal to 0 or greater than the number of column in row)
Search for    or go to Top of page |  Section 3 |  Main Index


PostgreSQL 9.5.2 SPI_MODIFYTUPLE (3) 2016

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.