Am 12.08.2013 22:21, schrieb Lars Kanis:
> Am 12.08.2013 20:58, schrieb mthompsonsf:
>> I'm using Postgres' "COPY FROM STDIN" functionality to bulkload some
>> data. The entire process fails if a single row fails, and the result
>> of the process is "PGRES_FATAL_ERROR". Is there a way to a) capture
>> the error for the failing row,
> Yes, I've done some minor modifications to your file in the attached
> diff, that should raise a proper exception in case of errors both on
> database side and on client side.
>
The copy process is not as simple as it should be, so I added proper
usage examples to the gem documentation:
https://bitbucket.org/ged/ruby-pg/commits/995900317
@ged: Maybe we should add two convenience methods, that take a block for
the data handling and cares about proper error handling around this
block. Could be named PG::Connection#copy_put and #copy_get ?
Regards,
Lars