@@ -781,8 +781,8 @@ int SPI_execute_with_args(const char *<parameter>command</parameter>,
781
781
<term><literal>Oid * <parameter>argtypes</parameter></literal></term>
782
782
<listitem>
783
783
<para>
784
- an array containing the <acronym>OID</acronym>s of
785
- the data types of the parameters
784
+ an array of length <parameter>nargs</parameter>, containing the
785
+ <acronym>OID</acronym>s of the data types of the parameters
786
786
</para>
787
787
</listitem>
788
788
</varlistentry>
@@ -791,7 +791,8 @@ int SPI_execute_with_args(const char *<parameter>command</parameter>,
791
791
<term><literal>Datum * <parameter>values</parameter></literal></term>
792
792
<listitem>
793
793
<para>
794
- an array of actual parameter values
794
+ an array of length <parameter>nargs</parameter>, containing the actual
795
+ parameter values
795
796
</para>
796
797
</listitem>
797
798
</varlistentry>
@@ -800,13 +801,20 @@ int SPI_execute_with_args(const char *<parameter>command</parameter>,
800
801
<term><literal>const char * <parameter>nulls</parameter></literal></term>
801
802
<listitem>
802
803
<para>
803
- an array describing which parameters are null
804
+ an array of length <parameter>nargs</parameter>, describing which
805
+ parameters are null
804
806
</para>
805
807
806
808
<para>
807
809
If <parameter>nulls</parameter> is <symbol>NULL</symbol> then
808
- <function>SPI_execute_with_args</function> assumes that no parameters are
809
- null.
810
+ <function>SPI_execute_with_args</function> assumes that no parameters
811
+ are null. Otherwise, each entry of the <parameter>nulls</parameter>
812
+ array should be <literal>' '</> if the corresponding parameter
813
+ value is non-null, or <literal>'n'</> if the corresponding parameter
814
+ value is null. (In the latter case, the actual value in the
815
+ corresponding <parameter>values</parameter> entry doesn't matter.) Note
816
+ that <parameter>nulls</parameter> is not a text string, just an array:
817
+ it does not need a <literal>'\0'</> terminator.
810
818
</para>
811
819
</listitem>
812
820
</varlistentry>
@@ -1456,15 +1464,18 @@ int SPI_execute_plan(SPIPlanPtr <parameter>plan</parameter>, Datum * <parameter>
1456
1464
<para>
1457
1465
An array describing which parameters are null. Must have same length as
1458
1466
the statement's number of arguments.
1459
- <literal>n</literal> indicates a null value (entry in
1460
- <parameter>values</> will be ignored); a space indicates a
1461
- nonnull value (entry in <parameter>values</> is valid).
1462
1467
</para>
1463
1468
1464
1469
<para>
1465
1470
If <parameter>nulls</parameter> is <symbol>NULL</symbol> then
1466
- <function>SPI_execute_plan</function> assumes that no parameters are
1467
- null.
1471
+ <function>SPI_execute_plan</function> assumes that no parameters
1472
+ are null. Otherwise, each entry of the <parameter>nulls</parameter>
1473
+ array should be <literal>' '</> if the corresponding parameter
1474
+ value is non-null, or <literal>'n'</> if the corresponding parameter
1475
+ value is null. (In the latter case, the actual value in the
1476
+ corresponding <parameter>values</parameter> entry doesn't matter.) Note
1477
+ that <parameter>nulls</parameter> is not a text string, just an array:
1478
+ it does not need a <literal>'\0'</> terminator.
1468
1479
</para>
1469
1480
</listitem>
1470
1481
</varlistentry>
@@ -1682,15 +1693,18 @@ int SPI_execp(SPIPlanPtr <parameter>plan</parameter>, Datum * <parameter>values<
1682
1693
<para>
1683
1694
An array describing which parameters are null. Must have same length as
1684
1695
the statement's number of arguments.
1685
- <literal>n</literal> indicates a null value (entry in
1686
- <parameter>values</> will be ignored); a space indicates a
1687
- nonnull value (entry in <parameter>values</> is valid).
1688
1696
</para>
1689
1697
1690
1698
<para>
1691
1699
If <parameter>nulls</parameter> is <symbol>NULL</symbol> then
1692
- <function>SPI_execp</function> assumes that no parameters are
1693
- null.
1700
+ <function>SPI_execp</function> assumes that no parameters
1701
+ are null. Otherwise, each entry of the <parameter>nulls</parameter>
1702
+ array should be <literal>' '</> if the corresponding parameter
1703
+ value is non-null, or <literal>'n'</> if the corresponding parameter
1704
+ value is null. (In the latter case, the actual value in the
1705
+ corresponding <parameter>values</parameter> entry doesn't matter.) Note
1706
+ that <parameter>nulls</parameter> is not a text string, just an array:
1707
+ it does not need a <literal>'\0'</> terminator.
1694
1708
</para>
1695
1709
</listitem>
1696
1710
</varlistentry>
@@ -1811,15 +1825,18 @@ Portal SPI_cursor_open(const char * <parameter>name</parameter>, SPIPlanPtr <par
1811
1825
<para>
1812
1826
An array describing which parameters are null. Must have same length as
1813
1827
the statement's number of arguments.
1814
- <literal>n</literal> indicates a null value (entry in
1815
- <parameter>values</> will be ignored); a space indicates a
1816
- nonnull value (entry in <parameter>values</> is valid).
1817
1828
</para>
1818
1829
1819
1830
<para>
1820
1831
If <parameter>nulls</parameter> is <symbol>NULL</symbol> then
1821
- <function>SPI_cursor_open</function> assumes that no parameters are
1822
- null.
1832
+ <function>SPI_cursor_open</function> assumes that no parameters
1833
+ are null. Otherwise, each entry of the <parameter>nulls</parameter>
1834
+ array should be <literal>' '</> if the corresponding parameter
1835
+ value is non-null, or <literal>'n'</> if the corresponding parameter
1836
+ value is null. (In the latter case, the actual value in the
1837
+ corresponding <parameter>values</parameter> entry doesn't matter.) Note
1838
+ that <parameter>nulls</parameter> is not a text string, just an array:
1839
+ it does not need a <literal>'\0'</> terminator.
1823
1840
</para>
1824
1841
</listitem>
1825
1842
</varlistentry>
@@ -1930,8 +1947,8 @@ Portal SPI_cursor_open_with_args(const char *<parameter>name</parameter>,
1930
1947
<term><literal>Oid * <parameter>argtypes</parameter></literal></term>
1931
1948
<listitem>
1932
1949
<para>
1933
- an array containing the <acronym>OID</acronym>s of
1934
- the data types of the parameters
1950
+ an array of length <parameter>nargs</parameter>, containing the
1951
+ <acronym>OID</acronym>s of the data types of the parameters
1935
1952
</para>
1936
1953
</listitem>
1937
1954
</varlistentry>
@@ -1940,7 +1957,8 @@ Portal SPI_cursor_open_with_args(const char *<parameter>name</parameter>,
1940
1957
<term><literal>Datum * <parameter>values</parameter></literal></term>
1941
1958
<listitem>
1942
1959
<para>
1943
- an array of actual parameter values
1960
+ an array of length <parameter>nargs</parameter>, containing the actual
1961
+ parameter values
1944
1962
</para>
1945
1963
</listitem>
1946
1964
</varlistentry>
@@ -1949,13 +1967,20 @@ Portal SPI_cursor_open_with_args(const char *<parameter>name</parameter>,
1949
1967
<term><literal>const char * <parameter>nulls</parameter></literal></term>
1950
1968
<listitem>
1951
1969
<para>
1952
- an array describing which parameters are null
1970
+ an array of length <parameter>nargs</parameter>, describing which
1971
+ parameters are null
1953
1972
</para>
1954
1973
1955
1974
<para>
1956
1975
If <parameter>nulls</parameter> is <symbol>NULL</symbol> then
1957
- <function>SPI_cursor_open_with_args</function> assumes that no
1958
- parameters are null.
1976
+ <function>SPI_cursor_open_with_args</function> assumes that no parameters
1977
+ are null. Otherwise, each entry of the <parameter>nulls</parameter>
1978
+ array should be <literal>' '</> if the corresponding parameter
1979
+ value is non-null, or <literal>'n'</> if the corresponding parameter
1980
+ value is null. (In the latter case, the actual value in the
1981
+ corresponding <parameter>values</parameter> entry doesn't matter.) Note
1982
+ that <parameter>nulls</parameter> is not a text string, just an array:
1983
+ it does not need a <literal>'\0'</> terminator.
1959
1984
</para>
1960
1985
</listitem>
1961
1986
</varlistentry>
@@ -3741,8 +3766,7 @@ HeapTuple SPI_modifytuple(Relation <parameter>rel</parameter>, HeapTuple <parame
3741
3766
<term><literal>int <parameter>ncols</parameter></literal></term>
3742
3767
<listitem>
3743
3768
<para>
3744
- number of column numbers in the array
3745
- <parameter>colnum</parameter>
3769
+ number of columns to be changed
3746
3770
</para>
3747
3771
</listitem>
3748
3772
</varlistentry>
@@ -3751,8 +3775,8 @@ HeapTuple SPI_modifytuple(Relation <parameter>rel</parameter>, HeapTuple <parame
3751
3775
<term><literal>int * <parameter>colnum</parameter></literal></term>
3752
3776
<listitem>
3753
3777
<para>
3754
- array of the numbers of the columns that are to be changed
3755
- (column numbers start at 1)
3778
+ an array of length <parameter>ncols</parameter>, containing the numbers
3779
+ of the columns that are to be changed (column numbers start at 1)
3756
3780
</para>
3757
3781
</listitem>
3758
3782
</varlistentry>
@@ -3761,17 +3785,30 @@ HeapTuple SPI_modifytuple(Relation <parameter>rel</parameter>, HeapTuple <parame
3761
3785
<term><literal>Datum * <parameter>values</parameter></literal></term>
3762
3786
<listitem>
3763
3787
<para>
3788
+ an array of length <parameter>ncols</parameter>, containing the
3764
3789
new values for the specified columns
3765
3790
</para>
3766
3791
</listitem>
3767
3792
</varlistentry>
3768
3793
3769
3794
<varlistentry>
3770
- <term><literal>const char * <parameter>Nulls </parameter></literal></term>
3795
+ <term><literal>const char * <parameter>nulls </parameter></literal></term>
3771
3796
<listitem>
3772
3797
<para>
3773
- which new values are null, if any (see
3774
- <function>SPI_execute_plan</function> for the format)
3798
+ an array of length <parameter>ncols</parameter>, describing which
3799
+ new values are null
3800
+ </para>
3801
+
3802
+ <para>
3803
+ If <parameter>nulls</parameter> is <symbol>NULL</symbol> then
3804
+ <function>SPI_modifytuple</function> assumes that no new values
3805
+ are null. Otherwise, each entry of the <parameter>nulls</parameter>
3806
+ array should be <literal>' '</> if the corresponding new value is
3807
+ non-null, or <literal>'n'</> if the corresponding new value is
3808
+ null. (In the latter case, the actual value in the corresponding
3809
+ <parameter>values</parameter> entry doesn't matter.) Note that
3810
+ <parameter>nulls</parameter> is not a text string, just an array: it
3811
+ does not need a <literal>'\0'</> terminator.
3775
3812
</para>
3776
3813
</listitem>
3777
3814
</varlistentry>
0 commit comments