Skip to content

Conversation

bgamari
Copy link
Contributor

@bgamari bgamari commented Apr 8, 2016

Although the documentation doesn't clearly state this, it turns out [1]
that it is necessary to request the status of a copy request after
PQputCopyEnd has returned successfully. Failing to do this will result
in later requests failing with "another command is already in progress".

[1] http://blog.endpoint.com/2011/05/dbdpg-and-libpq-copy-bug.html

Although the documentation doesn't clearly state this, it turns out [1]
that it is necessary to request the status of a copy request after
PQputCopyEnd has returned successfully. Failing to do this will result
in later requests failing with "another command is already in progress".

[1] http://blog.endpoint.com/2011/05/dbdpg-and-libpq-copy-bug.html
@lpsmith
Copy link
Owner

lpsmith commented Apr 8, 2016

Ehh? I've seen the link you've posted before, and this issue was fixed (?) via getCopyCommandTag / consumeResults IIRC.

@lpsmith
Copy link
Owner

lpsmith commented Apr 8, 2016

Ok, this issue was introduced in v0.4.3.0, reported in #119, and "fixed" by v0.4.4.1. Now, it's quite possible that the fix was wrong and/or incomplete, but this PR is making the regression test I added, fail.

@bgamari
Copy link
Contributor Author

bgamari commented Apr 8, 2016

Hmm, this is very odd. This patch does appear to resolve the issue that I had encountering (which matches the description of that blog article verbatim) but clearly more investigation is needed here.

@lpsmith
Copy link
Owner

lpsmith commented Apr 9, 2016

Well, I'm definitely interested in hearing about anything more you learn on this issue; as I said in issue 119, I wasn't exactly happy with the code that I wrote, as I didn't fully understand it, it didn't feel quite right, and basically the reason I wrote what I did was to make a simple smoke test work. LibPQ can certainly be a bit opaque around the edges.

@bgamari
Copy link
Contributor Author

bgamari commented Apr 11, 2016

It actually looks like this may have been due to an idiosyncrasy in my test test. Sorry for the noise!

@bgamari bgamari closed this Apr 11, 2016
@lpsmith
Copy link
Owner

lpsmith commented Apr 13, 2016

Oh no problem, I was kind of hoping for something interesting!

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.

2 participants