Using the copy protocol, is there a way to be notified of a potential error before sending?

From: Nicolas Grilly <nicolas(at)gardentechno(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Using the copy protocol, is there a way to be notified of a potential error before sending?
Date: 2011-02-01 15:52:10
Message-ID: AANLkTik5RaZ+CCBG28Q=giJLckvjPrTq5syA9TryUKSV@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is the copy protocol (aka PQputCopyData and PQputCopyEnd) designed to send
data during many minutes, and is there a way to be notified of a potential
error (for example an invalid value in one column) before sending
PQputCopyEnd? Or do I have to send my data in small chunks (for example
batch of 10000 rows), issue a PQputCopyEnd, check for errors, and continue
with the next chunk?

I tried the command "\copy ... from stdio" in psql and it looks like psql
has to read the entire input before returning an error, even if the invalid
value is in one of the first sent rows.

Thanks for your help and advice.

Regards,

Nicolas Grilly

Browse pgsql-general by date

  From Date Subject
Next Message Herouth Maoz 2011-02-01 15:56:20 Book recommendation?
Previous Message hlcborg 2011-02-01 15:36:56 Problem with encode () and hmac() in pgcrypto