septian(dot)hari(at)gmail(dot)com writes:
> We notice that for certain bad COPY statement, PQresultStatus will return
> PGRES_COPY_OUT instead of PGRES_FATAL_ERROR, and subsequently hide the error
> when using ruby pg gem.
The example seems perfectly fine to me: the error is detected at runtime,
so the COPY operation will start first, and that's when PGRES_COPY_OUT is
reported. I'm not sure what you mean by "hide the error" --- the error
certainly seems to be getting reported in the trace you show.
If there is any problem here, you probably need to discuss it with the
author of the Ruby pg gem. This list is mostly for reporting errors in
the core server.
regards, tom lane