aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-12-19 11:02:07 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2018-12-19 11:02:07 -0500
commit639924249c8a5e1929a0c74ab4ae15d18683e7fa (patch)
tree3ebba4be56ca4ed7f4d7d37812167f601013b5b1
parent61a4480a68ea44d0991d983a985ae2b2cd88cd61 (diff)
downloadpostgresql-639924249c8a5e1929a0c74ab4ae15d18683e7fa.tar.gz
postgresql-639924249c8a5e1929a0c74ab4ae15d18683e7fa.zip
Doc: fix incorrect example of collecting arguments with fmgr macros.
Thinko in commit f66912b0a. Back-patch to v10, as that was. Discussion: https://postgr.es/m/154522283371.15419.15167411691473730460@wrigleys.postgresql.org
-rw-r--r--doc/src/sgml/spi.sgml7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml
index 9db11d22fba..6f4f3bae6ff 100644
--- a/doc/src/sgml/spi.sgml
+++ b/doc/src/sgml/spi.sgml
@@ -4587,14 +4587,15 @@ execq(PG_FUNCTION_ARGS)
uint64 proc;
/* Convert given text object to a C string */
- command = text_to_cstring(PG_GETARG_TEXT_PP(1));
- cnt = PG_GETARG_INT32(2);
+ command = text_to_cstring(PG_GETARG_TEXT_PP(0));
+ cnt = PG_GETARG_INT32(1);
SPI_connect();
ret = SPI_exec(command, cnt);
proc = SPI_processed;
+
/*
* If some rows were fetched, print them via elog(INFO).
*/
@@ -4611,7 +4612,7 @@ execq(PG_FUNCTION_ARGS)
int i;
for (i = 1, buf[0] = 0; i &lt;= tupdesc-&gt;natts; i++)
- snprintf(buf + strlen (buf), sizeof(buf) - strlen(buf), " %s%s",
+ snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %s%s",
SPI_getvalue(tuple, tupdesc, i),
(i == tupdesc-&gt;natts) ? " " : " |");
elog(INFO, "EXECQ: %s", buf);