Re: PQputCopyEnd doesn't adhere to its API contract

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PQputCopyEnd doesn't adhere to its API contract
Date: 2014-09-08 22:24:58
Message-ID: CAKFQuwZwNiCv9R=ki-Xd2doa2nh+1tGKYVu-v3_LLaUBJ-tADg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Sep 8, 2014 at 6:19 PM, David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
wrote:

> On Mon, Sep 8, 2014 at 11:45 AM, Robert Haas [via PostgreSQL] <
> ml-node+s1045698n5818200h24(at)n5(dot)nabble(dot)com> wrote:
>
>> On Thu, Sep 4, 2014 at 6:38 PM, David Johnston
>> <[hidden email] <http://user/SendEmail.jtp?type=node&node=5818200&i=0>>
>> wrote:
>>
>> > One of the trade-offs I mentioned...its more style than anything but
>> > removing the parenthetical (if there is not error in the command) and
>> > writing it more directly seemed preferable in an overview such as this.
>> >
>> > Better: The function will either throw an error or return a PGresult
>> > object[...]
>>
>> Nope. This is not C++, nor is it the backend. It will not throw
>> anything.
>>
>>
> ​The current sentence reads:
> "​The response to this (if there is no error in the command) will be a
> PGresult object bearing a status code of PGRES_COPY_OUT or PGRES_COPY_IN
> (depending on the specified copy direction)."
>
> Maybe this is taken for granted by others, and thus can be excluded here,
> but I'm trying to specify what happens if there is an error in the
> command... Apparently one does not get back a PGresult object...
>
> Would simply saying: "A successful response to this will be a PGresult
> object..." be accurate (enough)?
>
>
​Apparently, NULL is the correct answer. Cannot that just be assumed to be
the case or does saying that a failure scenario here returns NULL (or
something other than pqResult object) impart useful knowledge?

Dave

--
View this message in context: http://postgresql.1045698.n5.nabble.com/PQputCopyEnd-doesn-t-adhere-to-its-API-contract-tp5803240p5818254.html
Sent from the PostgreSQL - hackers mailing list archive at Nabble.com.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2014-09-08 23:10:44 Re: Spinlocks and compiler/memory barriers
Previous Message David G Johnston 2014-09-08 22:20:25 Re: PQputCopyEnd doesn't adhere to its API contract