Re: SPI_connect, SPI_connect_ext return type
Stepan Neretin <sndcppg@gmail.com>
From: Stepan Neretin <sndcppg@gmail.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2024-08-10T18:34:43Z
Lists: pgsql-hackers
Attachments
- v1-0001-Fix-SPI-Documentation.patch (text/x-patch) patch v1-0001
> I'd give it decent odds since our example usage doesn't include the test. > https://www.postgresql.org/docs/current/spi-examples.html https://www.postgresql.org/docs/devel/trigger-example.html <https://www.postgresql.org/docs/current/spi-examples.html> > /* connect to SPI manager */ > if ((ret = SPI_connect()) < 0) > elog(ERROR, "trigf (fired %s): SPI_connect returned %d", when, ret); in this page check include in the example. I think we need to give examples of one kind. If there is no void in the code, then there should be checks everywhere (at least in the documentation). What do you think about the attached patch? Best Regards, Stepan Neretin.
Commits
-
Don't bother checking the result of SPI_connect[_ext] anymore.
- 218527d01456 18.0 landed