libpq: How to cancel a COPY ... TO statement?

From: Daniel Frey <d(dot)frey(at)gmx(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: libpq: How to cancel a COPY ... TO statement?
Date: 2021-11-08 18:59:01
Message-ID: 63674FDD-D20C-4EB3-A0E3-3C04C4BF802F@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

after sending a COPY ... TO statement with PQsendQuery(), how can I cancel it properly?

I tried using PQcancel(), but it seems to have no effect. Calling PQgetCopyData() or PQgetResult() afterwards does not go into a failure state. And I don't want to call PQgetCopyData() until it returns -1, as this might be a lot of data being read from the server that I don't need.

BR, Daniel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2021-11-08 19:05:41 Re: libpq: How to cancel a COPY ... TO statement?
Previous Message Oleg Serov 2021-11-08 18:03:32 Re: Question: Is it possible to get the new xlog position after query execution?