PQputCopyData dont signal error

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: PQputCopyData dont signal error
Date: 2011-04-14 07:15:23
Message-ID: BANLkTimV4Oyg=wBeuwDQvBSqzFcdJJMxdw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2011-04-14 07:50:16 Re: PQputCopyData dont signal error
Previous Message Greg Smith 2011-04-14 07:08:16 Single client performance on trivial SELECTs