Thanks Craig and Michael for confirming that "PQsetSingleRowMode" should be called right after "PQbatchQueueProcess".
Michael Paquier wrote: > It seems to me that >this should also be effective only during the fetching of one single >result set. When the client moves on to the next item in the queue we >should make necessary again a call to PQsetSingleRowMode(). Yes, the current behavior(with V6 code patch) is exactly the same as you described above. PQsetSingleRowMode() should be called each time after "PQbatchQueueProcess" to set result processing to single-row mode. >src/test/modules/Makefile should include test_libpq. Yes, added test_libpq to the list in Makefile. Daniel Verite wrote: >> Please let me know if you think this is not enough but wanted to update >> section 33.6 also? >Yes, if the right place to call PQsetSingleRowMode() is immediately >after PQbatchQueueProcess(), I think we need to update >"33.6. Retrieving Query Results Row-By-Row" >with that information, otherwise what it says is just wrong >when in batch mode. Yes, I have updated Chapter 33.6 by adding note for batch mode. >Also, in 33.5, I suggest to not use the "currently executing >query" as a synonym for the "query currently being processed" >to avoid any confusion between what the backend is executing >and a prior query whose results are being collected by the client >at the same moment. Yes correct, I modified the words to "query currently being processed" as suggested. > One bit of functionality that does not work in batch mode and is left > as is by the patch is the PQfn() fast path interface and the large object > functions that use it. > > Currently, calling lo_* functions inside a batch will fail with a message > that depends on whether the internal lo_initialize() has been successfully > called before. > > If it hasn't, PQerrorMessage() will be: > "Synchronous command execution functions are not allowed in batch mode" > which is fine, but it comes by happenstance from lo_initialize() > calling PQexec() to fetch the function OIDs from pg_catalog.pg_proc. > > OTOH, if lo_initialize() has succeeded before, a call to a large > object function will fail with a different message: > "connection in wrong state" > which is emitted by PQfn() based on conn->asyncStatus != PGASYNC_IDLE > > Having an unified error message would be more user friendly. > > Thanks for finding out this and yes, added a new check in PQfn() to give the same error message - "Synchronous command execution functions are not allowed in batch mode" when called in batch mode. > Concerning the doc, when saying in 33.5.2: > "In batch mode only asynchronous operations are permitted" > the server-side functions are indeed ruled out, since PQfn() is > synchronous, but maybe we should be a bit more explicit > about that? > Chapter 34.3 (Large Objects / Client Interfaces) could also > mention the incompatibility with batch mode. > > Updated 33.5.2 to be more clear about what functions are allowed and what are not allowed. Updated Chapter 33.3(Large Objects/ Client Interfaces) to let the user know about the incompatibility with batch mode . Attached the latest patch and here is the RT run result: ok 1 - testlibpqbatch disallowed_in_batch ok 2 - testlibpqbatch simple_batch ok 3 - testlibpqbatch multi_batch ok 4 - testlibpqbatch batch_abort ok 5 - testlibpqbatch timings ok 6 - testlibpqbatch copyfailure ok 7 - testlibpqbatch test_singlerowmode ok All tests successful. Files=1, Tests=7, 5 wallclock secs ( 0.01 usr 0.00 sys + 1.79 cusr 0.35 csys = 2.15 CPU) Result: PASS Thanks & Regards, Vaishnavi, Fujitsu Australia.
Description: Binary data
Description: Binary data
-- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers