summaryrefslogtreecommitdiff
path: root/doc/src/sgml/pltcl.sgml
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2023-05-02 17:55:01 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2023-05-02 17:55:01 -0400
commit6489875ce6b16662142bc70e003437b9753c199f (patch)
tree178cbd305a92055daac09148272a9e562677f2bb /doc/src/sgml/pltcl.sgml
parent08237056f84e3a9ed75e8a698428c669f4d35db4 (diff)
downloadpostgresql-6489875ce6b16662142bc70e003437b9753c199f.tar.gz
Doc: clarify behavior of row-limit arguments in the PLs' SPI wrappers.
plperl, plpython, and pltcl all provide query-execution functions that are thin wrappers around SPI_execute() or its variants. The SPI functions document their row-count limit arguments clearly, as "maximum number of rows to return, or 0 for no limit". However the PLs' documentation failed to explain this special behavior of zero, so that a reader might well assume it means "fetch zero rows". Improve that. Daniel Gustafsson and Tom Lane, per report from Kieran McCusker Discussion: https://postgr.es/m/CAGgUQ6H6qYScctOhktQ9HLFDDoafBKHyUgJbZ6q_dOApnzNTXg@mail.gmail.com
Diffstat (limited to 'doc/src/sgml/pltcl.sgml')
-rw-r--r--doc/src/sgml/pltcl.sgml8
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/src/sgml/pltcl.sgml b/doc/src/sgml/pltcl.sgml
index bf56ba6b1c..b31f2c1330 100644
--- a/doc/src/sgml/pltcl.sgml
+++ b/doc/src/sgml/pltcl.sgml
@@ -341,9 +341,11 @@ $$ LANGUAGE pltcl;
</para>
<para>
The optional <literal>-count</literal> value tells
- <function>spi_exec</function> the maximum number of rows
- to process in the command. The effect of this is comparable to
- setting up a query as a cursor and then saying <literal>FETCH <replaceable>n</replaceable></literal>.
+ <function>spi_exec</function> to stop
+ once <replaceable>n</replaceable> rows have been retrieved,
+ much as if the query included a <literal>LIMIT</literal> clause.
+ If <replaceable>n</replaceable> is zero, the query is run to
+ completion, the same as when <literal>-count</literal> is omitted.
</para>
<para>
If the command is a <command>SELECT</command> statement, the values of the