Am 05.10.2019 um 02:07 schrieb Justin Pryzby:
On Wed, May 15, 2019 at 08:44:49AM -0500, Justin Pryzby wrote:
Also, as of PG12 (unreleased), there'll be this new interface:
https://www.postgresql.org/docs/devel/release-12.html#id-1.3.7
|Add libpq function to report the memory size of the query result (Lars Kanis, 
Tom Lane)
|The function is PQresultMemorySize().

I'd propose to include that with the first release following PG12...although I
think you'd have to check PG_VERSION_NUM or similar, which I see isn't
currently being done.

Find attached minimal patch.

Thank you, looks fine. I've already added docs and tests as well, but not yet committed to trunk.

In addition to query.memsize() I've also added get_pqlib_version() as a module level function.

But I wonder if we should create a new minor version (5.2) instead of patch release (5.1.1) since it's new functionality?

Another thing I'd also like to address is the overall handling of functionality that is optional or does only work with newer pqlib versions. Currently these are behind compiler switches which are set in setup.py, by default they are enabled if the pqlib version is new enough to support the respective functionality.

Alternatively, the pqlib version could be checked directly using pg_config.h in the code instead of using the various switches, like you are doing here. I'd like to handle this more consistently through the code. But this would also warrant a new 5.2 version:
see https://github.com/Cito/PyGreSQL/issues/12

-- Christoph

_______________________________________________
PyGreSQL mailing list
PyGreSQL@Vex.Net
https://mail.vex.net/mailman/listinfo/pygresql

Reply via email to