8000 Switch to using libpq async API. by dimitri · Pull Request #488 · dimitri/pgcopydb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Switch to using libpq async API. #488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 11, 2023
Merged

Conversation

dimitri
Copy link
Owner
@dimitri dimitri commented Oct 9, 2023

The easy to use API PQexec() and PQexecParams() are blocking, which means those functions could fail to detect when a Postgres connection has been lost, and now wait an indefinite amount of time.

Switch to using the async API PQsendQuery() or PQsendQueryParams() with the PQgetResult() function, all with some lower-level socket API calls such as select(2) and PQconsumeInput() and PQisBusy().

Note that when the server is no longer busy computing the result, we should loop over all the available results... apparently.

Fixes #477

The easy to use API PQexec() and PQexecParams() are blocking, which means
those functions could fail to detect when a Postgres connection has been
lost, and now wait an indefinite amount of time.

Switch to using the async API PQsendQuery() or PQsendQueryParams() with the
PQgetResult() function, all with some lower-level socket API calls such as
select(2) and PQconsumeInput() and PQisBusy().

Note that when the server is no longer busy computing the result, we should
loop over all the available results... apparently.
@dimitri dimitri force-pushed the feature/libpq-send-query-get-result branch from ae8e2c3 to 191c711 Compare October 11, 2023 16:31
@dimitri dimitri merged commit a701e78 into main Oct 11, 2023
@dimitri dimitri deleted the feature/libpq-send-query-get-result branch October 11, 2023 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve exit of pgcopydb on failure
1 participant
0