| От | Tom Lane |
|---|---|
| Тема | Re: libpq: How to cancel a COPY ... TO statement? |
| Дата | |
| Msg-id | 991131.1636398341@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | libpq: How to cancel a COPY ... TO statement? (Daniel Frey <d.frey@gmx.de>) |
| Список | pgsql-general |
Daniel Frey <d.frey@gmx.de> writes:
> after sending a COPY ... TO statement with PQsendQuery(), how can I cancel it properly?
> I tried using PQcancel(),
That's the correct way.
> but it seems to have no effect. Calling PQgetCopyData() or PQgetResult() afterwards does not go into a failure state.
AndI don't want to call PQgetCopyData() until it returns -1, as this might be a lot of data being read from the server
thatI don't need.
You can't expect instantaneous response to a cancel. For one thing, the
server might have already stuffed a good deal of data down the pipe.
You should keep pulling (and discarding) data until you get the end
or error response.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера