Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2015-01-22 Thread Bruce Momjian
On Fri, Jan 9, 2015 at 03:04:19PM -0500, Bruce Momjian wrote: Uh, where are we on this? I think someone needs to take Tom's proposed language and make it into a patch. And figure out which other functions in the documentation need similar updates. I have developed such a patch ---

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2015-01-09 Thread Bruce Momjian
On Thu, Sep 4, 2014 at 12:52:14PM -0400, Robert Haas wrote: On Wed, Sep 3, 2014 at 6:24 PM, Bruce Momjian br...@momjian.us wrote: On Fri, May 9, 2014 at 12:03:36PM -0400, Robert Haas wrote: On Thu, May 8, 2014 at 5:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: Perhaps the text should be like

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-09 Thread Robert Haas
On Mon, Sep 8, 2014 at 6:20 PM, David G Johnston david.g.johns...@gmail.com wrote: On Mon, Sep 8, 2014 at 11:45 AM, Robert Haas [via PostgreSQL] [hidden email] wrote: On Thu, Sep 4, 2014 at 6:38 PM, David Johnston [hidden email] wrote: One of the trade-offs I mentioned...its more style

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-09 Thread David Johnston
On Tue, Sep 9, 2014 at 12:03 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, Sep 8, 2014 at 6:20 PM, David G Johnston david.g.johns...@gmail.com wrote: On Mon, Sep 8, 2014 at 11:45 AM, Robert Haas [via PostgreSQL] [hidden email] wrote: On Thu, Sep 4, 2014 at 6:38 PM, David Johnston

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-08 Thread Robert Haas
On Thu, Sep 4, 2014 at 6:38 PM, David Johnston david.g.johns...@gmail.com wrote: The implied suggestion is that if I do find any other areas that look like they need fixing - even in the same file - I should separate them out into a separate patch. Yes. Though I have seen various while I was

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-08 Thread David G Johnston
On Mon, Sep 8, 2014 at 11:45 AM, Robert Haas [via PostgreSQL] ml-node+s1045698n5818200...@n5.nabble.com wrote: On Thu, Sep 4, 2014 at 6:38 PM, David Johnston [hidden email] http://user/SendEmail.jtp?type=nodenode=5818200i=0 wrote: One of the trade-offs I mentioned...its more style than

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-08 Thread David G Johnston
On Mon, Sep 8, 2014 at 6:19 PM, David Johnston david.g.johns...@gmail.com wrote: On Mon, Sep 8, 2014 at 11:45 AM, Robert Haas [via PostgreSQL] ml-node+s1045698n5818200...@n5.nabble.com wrote: On Thu, Sep 4, 2014 at 6:38 PM, David Johnston [hidden email]

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-04 Thread David G Johnston
On Wed, Sep 3, 2014 at 6:25 PM, Bruce Momjian [via PostgreSQL] ml-node+s1045698n5817646...@n5.nabble.com wrote: On Fri, May 9, 2014 at 12:03:36PM -0400, Robert Haas wrote: On Thu, May 8, 2014 at 5:21 PM, Tom Lane [hidden email] http://user/SendEmail.jtp?type=nodenode=5817646i=0 wrote:

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-04 Thread Robert Haas
On Wed, Sep 3, 2014 at 6:24 PM, Bruce Momjian br...@momjian.us wrote: On Fri, May 9, 2014 at 12:03:36PM -0400, Robert Haas wrote: On Thu, May 8, 2014 at 5:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: Perhaps the text should be like this: The result is 1 if the termination message was sent;

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-04 Thread Bruce Momjian
On Thu, Sep 4, 2014 at 12:52:14PM -0400, Robert Haas wrote: On Wed, Sep 3, 2014 at 6:24 PM, Bruce Momjian br...@momjian.us wrote: On Fri, May 9, 2014 at 12:03:36PM -0400, Robert Haas wrote: On Thu, May 8, 2014 at 5:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: Perhaps the text should be like

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-04 Thread Robert Haas
On Thu, Sep 4, 2014 at 12:53 PM, Bruce Momjian br...@momjian.us wrote: On Thu, Sep 4, 2014 at 12:52:14PM -0400, Robert Haas wrote: On Wed, Sep 3, 2014 at 6:24 PM, Bruce Momjian br...@momjian.us wrote: On Fri, May 9, 2014 at 12:03:36PM -0400, Robert Haas wrote: On Thu, May 8, 2014 at 5:21

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-04 Thread David G Johnston
On Thu, Sep 4, 2014 at 1:00 PM, Robert Haas [via PostgreSQL] ml-node+s1045698n581780...@n5.nabble.com wrote: On Thu, Sep 4, 2014 at 12:53 PM, Bruce Momjian [hidden email] http://user/SendEmail.jtp?type=nodenode=5817809i=0 wrote: On Thu, Sep 4, 2014 at 12:52:14PM -0400, Robert Haas wrote:

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-04 Thread Robert Haas
On Thu, Sep 4, 2014 at 1:18 PM, David G Johnston david.g.johns...@gmail.com wrote: Specific observations would help though that is partly the idea - I've been more focused on clarity and organization even if it requires deviating from the current general documentation style. OK. - to the

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-04 Thread David Johnston
On Thu, Sep 4, 2014 at 5:13 PM, Robert Haas robertmh...@gmail.com wrote: On Thu, Sep 4, 2014 at 1:18 PM, David G Johnston david.g.johns...@gmail.com wrote: Specific observations would help though that is partly the idea - I've been more focused on clarity and organization even if it

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-09-03 Thread Bruce Momjian
On Fri, May 9, 2014 at 12:03:36PM -0400, Robert Haas wrote: On Thu, May 8, 2014 at 5:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: Perhaps the text should be like this: The result is 1 if the termination message was sent; or in nonblocking mode, this may only indicate that the termination

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-09 Thread Robert Haas
On Thu, May 8, 2014 at 5:21 PM, Tom Lane t...@sss.pgh.pa.us wrote: Perhaps the text should be like this: The result is 1 if the termination message was sent; or in nonblocking mode, this may only indicate that the termination message was successfully queued. (In nonblocking mode, to be

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-09 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: That looks pretty good. However, I'm realizing this isn't the only place where we probably need to clarify the language. Just to take one example near at hand, PQputCopyData may also return 1 when it's only queued the data; it seems to try even less

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-08 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: According to the documentation for PQputCopyEnd: The result is 1 if the termination data was sent, zero if it was not sent because the attempt would block (this case is only possible if the connection is in nonblocking mode), or -1 if an error

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-08 Thread Robert Haas
On Thu, May 8, 2014 at 12:09 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: According to the documentation for PQputCopyEnd: The result is 1 if the termination data was sent, zero if it was not sent because the attempt would block (this case is only possible

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-08 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: What I'm now thinking I need to do is something like this: 1. If PQputCopyEnd returns -1, error. 2. while ((rc = PQflush(conn)) != 0) { if (rc 0) { error; } else { wait for socket to become read-ready or write-ready; } } 3. while (PQisBusy(conn)) {

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-08 Thread Robert Haas
On Thu, May 8, 2014 at 12:53 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: What I'm now thinking I need to do is something like this: 1. If PQputCopyEnd returns -1, error. 2. while ((rc = PQflush(conn)) != 0) { if (rc 0) { error; } else { wait for socket

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-08 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: OK. It still seems to me that there's a doc fix needed here, if nothing else. The documentation for PQputCopyEnd() clearly implies that if you get a return value of 1, the message is sent, and that's just not true. That's fair.

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-08 Thread Robert Haas
On Thu, May 8, 2014 at 1:51 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: OK. It still seems to me that there's a doc fix needed here, if nothing else. The documentation for PQputCopyEnd() clearly implies that if you get a return value of 1, the message is

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-08 Thread Tom Lane
Robert Haas robertmh...@gmail.com writes: On Thu, May 8, 2014 at 1:51 PM, Tom Lane t...@sss.pgh.pa.us wrote: Robert Haas robertmh...@gmail.com writes: OK. It still seems to me that there's a doc fix needed here, if nothing else. The documentation for PQputCopyEnd() clearly implies that if

Re: [HACKERS] PQputCopyEnd doesn't adhere to its API contract

2014-05-08 Thread David G Johnston
Tom Lane-2 wrote Robert Haas lt; robertmhaas@ gt; writes: On Thu, May 8, 2014 at 1:51 PM, Tom Lane lt; tgl@.pa gt; wrote: Robert Haas lt; robertmhaas@ gt; writes: OK. It still seems to me that there's a doc fix needed here, if nothing else. The documentation for PQputCopyEnd()