A call to PQsetSingleRowMode just after PQsendQueryPrepared solved my issue.
Regards,
Brice
Le dim. 12 déc. 2021 à 19:43, Tom Lane <tgl@sss.pgh.pa.us> a écrit :
Brice André <brice@famille-andre.be> writes: > The content of the table is so huge that, if PQsendQueryPrepared retrieves > all data, or if postgresql engine is creating temp file with all data, the > query cannot succeed (I have no enough RAM or disk space to copy the whole > data). But I was expecting that using PQsendQueryPrepared and PQgetResult > would avoid this by returning one result at a time.
You're confusing asynchronous mode with single-row mode. Async mode, per se, doesn't change memory consumption; it just lets you do something else while waiting for the query result. You are (I suppose) missing a call to PQsetSingleRowMode --- see