diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-12-19 11:02:08 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-12-19 11:02:08 -0500 |
commit | 4aad9813e8040ea8ad7a149ee5724ee3631c6d55 (patch) | |
tree | 53532a345fb82f3c52bcc51199b022b1bcf9c438 | |
parent | d16567093f734004d0e54e54b2ebf041a6e8ae9c (diff) |
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.sgml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml index 1f13b88e05d..7f937e269c8 100644 --- a/doc/src/sgml/spi.sgml +++ b/doc/src/sgml/spi.sgml @@ -4366,14 +4366,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). */ @@ -4390,7 +4391,7 @@ execq(PG_FUNCTION_ARGS) int i; for (i = 1, buf[0] = 0; i <= tupdesc->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->natts) ? " " : " |"); elog(INFO, "EXECQ: %s", buf); |