Error in example

Started by PG Bug reporting formover 7 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/10/spi-examples.html
Description:

Dear,

In the example of how to use SPI in the following link
https://www.postgresql.org/docs/10/spi-examples.html

The parameters numbers in the follow lines are wrong.

/ * Convert a text object to a C string * /
command = text_to_cstring (PG_GETARG_TEXT_PP (1));
cnt = PG_GETARG_INT32 (2);

They should be as follow:

/ * Convert a text object to a C string * /
command = text_to_cstring (PG_GETARG_TEXT_PP (0));
cnt = PG_GETARG_INT32 (1);

Best regards,
Gláucio

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: Error in example

=?utf-8?q?PG_Doc_comments_form?= <noreply@postgresql.org> writes:

In the example of how to use SPI in the following link
https://www.postgresql.org/docs/10/spi-examples.html
The parameters numbers in the follow lines are wrong.
/ * Convert a text object to a C string * /
command = text_to_cstring (PG_GETARG_TEXT_PP (1));
cnt = PG_GETARG_INT32 (2);

You're right. Will fix, thanks for the report!

regards, tom lane