Skip to content
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

Add a pg_background_discard_result() function. #41

Closed
wants to merge 1 commit into from
Closed

Conversation

rjuju
Copy link
Collaborator

@rjuju rjuju commented Oct 6, 2022

This function will consume all protocol messages, discard all data and will only rethrow any error data emitted during the background query execution.

This allows users to execute any kind of SQL without worrying of specifying a column definition list matching the last emitted resultset if they're not interested in the resultset, but still want to actively wait for the background execution completion and want know if any error happened during the background execution.

This function will consume all protocol messages, discard all data and will
only rethrow any error data emitted during the background query execution.

This allows users to execute any kind of SQL without worrying of specifying a
column definition list matching the last emitted resultset if they're not
interested in the resultset, but still want to actively wait for the background
execution completion and want know if any error happened during the background
execution.
@rjuju rjuju requested a review from vibhorkum October 6, 2022 14:52
@rjuju
Copy link
Collaborator Author

rjuju commented Oct 6, 2022

@vibhorkum as discussed in #39, here's a function to consume all messages and discard everything but the error data.

I tried to maintain the previous code as much as it was (so using the ValuePerCall API), and avoid code duplication by simply not executing the SRF API in the discard mode. It just means that the initialization is done in multiple steps, but the code is still straightforward, and I added some comments on top of it. Documentation is also updated and a new regression tests added.

Let me know if you have any comment.

@rjuju rjuju closed this Oct 14, 2022
@rjuju rjuju deleted the discard_rows branch October 14, 2022 05:50
@vibhorkum
Copy link
Owner

Hi @rjuju It looks like you have closed this PR. I was traveling and I missed this. Do you want to re-submit this PR? or are you planning to submit other version?

@vibhorkum vibhorkum restored the discard_rows branch October 17, 2022 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants