int status;
if (conn->sock < 0 ||
- conn->asyncStatus != PGASYNC_COPY_OUT ||
+ (conn->asyncStatus != PGASYNC_COPY_OUT &&
+ conn->asyncStatus != PGASYNC_COPY_BOTH) ||
conn->copy_is_binary)
{
printfPQExpBuffer(&conn->errorMessage,
int msgLength;
int avail;
- if (conn->asyncStatus != PGASYNC_COPY_OUT)
+ if (conn->asyncStatus != PGASYNC_COPY_OUT
+ && conn->asyncStatus != PGASYNC_COPY_BOTH)
return -1; /* we are not doing a copy... */
/*
PGresult *result;
if (conn->asyncStatus != PGASYNC_COPY_IN &&
- conn->asyncStatus != PGASYNC_COPY_OUT)
+ conn->asyncStatus != PGASYNC_COPY_OUT &&
+ conn->asyncStatus != PGASYNC_COPY_BOTH)
{
printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("no COPY in progress\n"));
}
/* Send the CopyDone message if needed */
- if (conn->asyncStatus == PGASYNC_COPY_IN)
+ if (conn->asyncStatus == PGASYNC_COPY_IN ||
+ conn->asyncStatus == PGASYNC_COPY_BOTH)
{
if (pqPutMsgStart('c', false, conn) < 0 ||
pqPutMsgEnd(conn) < 0)