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

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 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 wrote: > >> > Perhaps the text should be like this: > >> > > >> > The

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 wrote: > On Mon, Sep 8, 2014 at 6:20 PM, David G Johnston > 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: > >>

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 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 than anything

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 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-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] > > wrote: > > > One of the trade-offs I mentioned...its more s

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 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 in there I also > fix

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 wrote: > On Thu, Sep 4, 2014 at 1:18 PM, David G Johnston > 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 gener

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 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 network connection used by

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] > > wrote: > > > On Thu, Sep 4, 2014 at 12:52:14PM -0400, Robert H

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 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 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 wrote: >>

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 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 wrote: > >> > Perhaps the text should be like this: > >> > > >> > The

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 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 wrote: >> > Perhaps the text should be like this: >> > >> > The result is 1 if the termination message was sent; or in nonblocking >> > m

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

2014-09-03 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] > >

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 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

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

2014-05-09 Thread Tom Lane
Robert Haas 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 hard than PQputCo

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 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 certain that the da

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

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

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

2014-05-08 Thread Tom Lane
Robert Haas writes: > On Thu, May 8, 2014 at 1:51 PM, Tom Lane wrote: >> Robert Haas 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,

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 wrote: > Robert Haas 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

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

2014-05-08 Thread Tom Lane
Robert Haas 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. regards, tom l

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 wrote: > Robert Haas 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-

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

2014-05-08 Thread Tom Lane
Robert Haas 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)) { wait for the soc

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 wrote: > Robert Haas 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 >>

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

2014-05-08 Thread Tom Lane
Robert Haas 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 occurred. (Use PQe

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

2014-05-08 Thread Robert Haas
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 occurred. (Use PQerrorMessage to > retrieve