Re: BUG #13865: PQresultStatus returns PGRES_COPY_OUT instead of PGRES_FATAL_ERROR for certain bad COPY statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: septian(dot)hari(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13865: PQresultStatus returns PGRES_COPY_OUT instead of PGRES_FATAL_ERROR for certain bad COPY statement
Date: 2016-01-15 16:54:11
Message-ID: 22381.1452876851@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-01-15 16:58:35 Re: BUG #13864: Reproducible, ERROR: could not read block 30 in file "base/16414/11914": read only 0 of 8192 bytes
Previous Message Shulgin, Oleksandr 2016-01-15 16:34:20 Re: BUG #13862: Duplicated rows for a table with primary key