"Boris" <admin@nyc.yamaha.com> writes:
> while ((result = PQgetResult(conn)) != NULL){
> ExecStatusType resultStatus = result->resultStatus;
> PQclear(result); /* only need its status */
> /* check for loss of connection, too */
> if (result->resultStatus == PGRES_COPY_IN ||
> result->resultStatus == PGRES_COPY_OUT ||
> conn->status == CONNECTION_BAD)
> break;
> }
This code is broken: once you've done PQclear() it's unsafe to access
the PGresult. I think you meant just "resultStatus" not
"result->resultStatus" in the if().
regards, tom lane