Fixed hangup of execution of queries like "COPY TO STDIN" in asynchronous mode.#101
Fixed hangup of execution of queries like "COPY TO STDIN" in asynchronous mode.#101true-alex wants to merge 2 commits intobucardo:masterfrom
Conversation
|
Do you have a working test script that demonstrates this? While digging in, I found some other issues with regards to async COPY so I want to make sure I fix it all at once. |
|
A lot of time has passed, the server is already down. |
|
Thank you. I think we are simply going to disallow calling pg_result after an asynchronous COPY, as it's not the same as the non-COPY cases where we can simply wait for the server to finish. |
|
In the current version of the module, if pg_result is not called after a successful pg_ready, an error will occur, since pg_result sets the status of waiting for data from COPY. |
|
What is the status of this? Please take a look at the new async code changes and see if you want to adjust this PR. |
The problem is in the wrong sequence of calls when processing the result of calling the COPY command in asynchronous mode.
#98
The problem is that the pg_db_result method tries to get the result of the query before it completes. The result of the COPY command will be only after the end of reading / writing the data stream.
Perhaps the problem can be solved differently, I did not want to change the source code much.