PQputCopyData dont signal error - Mailing list pgsql-hackers

From Pavel Stehule
Subject PQputCopyData dont signal error
Date
Msg-id BANLkTimV4Oyg=wBeuwDQvBSqzFcdJJMxdw@mail.gmail.com
Whole thread Raw
Responses Re: PQputCopyData dont signal error  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
Hello

I have a problem with PQputCopyData function. It doesn't signal some error.
    while ((row = mysql_fetch_row(res)) != NULL)    {        snprintf(buffer, sizeof(buffer), "%s%s\n", row[0],
row[1]);       copy_result = PQputCopyData(pconn, buffer, strlen(buffer));        printf(">>%s<<\n",
PQerrorMessage(pconn));       printf("%d\n", copy_result);        if (copy_result != 1)        {
fprintf(stderr,"Copy to target table failed: %s",                    PQerrorMessage(pconn));            EXIT;        }
 }
 

it returns 1 for broken values too :(

Is necessary some special check?

Regards

Pavel Stehule


pgsql-hackers by date:

Previous
From: Greg Smith
Date:
Subject: Single client performance on trivial SELECTs
Next
From: Pavel Stehule
Date:
Subject: Re: PQputCopyData dont signal error