Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6399242

Browse files
committed
Doc: fix incorrect example of collecting arguments with fmgr macros.
Thinko in commit f66912b. Back-patch to v10, as that was. Discussion: https://postgr.es/m/154522283371.15419.15167411691473730460@wrigleys.postgresql.org
1 parent 61a4480 commit 6399242

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/src/sgml/spi.sgml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4587,14 +4587,15 @@ execq(PG_FUNCTION_ARGS)
45874587
uint64 proc;
45884588

45894589
/* Convert given text object to a C string */
4590-
command = text_to_cstring(PG_GETARG_TEXT_PP(1));
4591-
cnt = PG_GETARG_INT32(2);
4590+
command = text_to_cstring(PG_GETARG_TEXT_PP(0));
4591+
cnt = PG_GETARG_INT32(1);
45924592

45934593
SPI_connect();
45944594

45954595
ret = SPI_exec(command, cnt);
45964596

45974597
proc = SPI_processed;
4598+
45984599
/*
45994600
* If some rows were fetched, print them via elog(INFO).
46004601
*/
@@ -4611,7 +4612,7 @@ execq(PG_FUNCTION_ARGS)
46114612
int i;
46124613

46134614
for (i = 1, buf[0] = 0; i <= tupdesc->natts; i++)
4614-
snprintf(buf + strlen (buf), sizeof(buf) - strlen(buf), " %s%s",
4615+
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %s%s",
46154616
SPI_getvalue(tuple, tupdesc, i),
46164617
(i == tupdesc->natts) ? " " : " |");
46174618
elog(INFO, "EXECQ: %s", buf);

0 commit comments

Comments
 (0)