CrunchyData / pgnodemx

A PostgreSQL extension that provides SQL functions to allow capture of node OS metrics via SQL queries.
Apache License 2.0
49 stars 11 forks source link

Remove Call to tuplestore_donestoring for PG 17 #22

Closed andrewlecuyer closed 2 months ago

andrewlecuyer commented 2 months ago

When building pgnodemx with Postgres 17, the following error is seen:

genutils.c: In function ‘form_srf’:
genutils.c:281:9: error: implicit declaration of function ‘tuplestore_donestoring’; did you mean ‘tuplestore_rescan’? [-Wimplicit-function-declaration]
  281 |         tuplestore_donestoring(tupstore);
      |         ^~~~~~~~~~~~~~~~~~~~~~
      |         tuplestore_rescan

Further analysis shows indicates that tuplestore_donestoring was removed in Postgres 17:

Additionally, looking back at the previous version of Postgres where tuplestore_donestoring was still present, we can see that it has been a no-op for some time now (well past all actively supported versions of PG):

Therefore, fixing this appears to be as simple as removing the line with the cll to tuplestore_donestoring. This is discussed in the PG mailing list thread for the removal of tuplestore_donestoring:

…Even if an extension is using them today, you'll get the same behavior as before if you remove the uses and rebuild against v12-v16.

This PR therefore removes a call to tuplestore_donestoring for proper compatibility with Postgres 17.

andrewlecuyer commented 2 months ago

@keithf4 @cbandy could you take a quick look at this one?

keithf4 commented 2 months ago

This sounds good to me. If @cbandy has no objection, I can get this ready for a new release

andrewlecuyer commented 2 months ago

@keithf4 that sounds great, much appreciated. And if anything I can do to help w/the release, just let me know.