Re: pl/tcl function to detect when a request has been canceled

Поиск
Список
Период
Сортировка
От Peter Da Silva
Тема Re: pl/tcl function to detect when a request has been canceled
Дата
Msg-id 91E0AE11-E371-40DE-8FE7-CBE50932D2D1@flightaware.com
обсуждение исходный текст
Ответ на Re: pl/tcl function to detect when a request has been canceled  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On 6/8/18, 2:21 PM, "Andres Freund" <andres@anarazel.de> wrote:
    Not sure I quite understand what you mean. You're thinking of the case
    where you're processing rows one-by-one with a cursor? Or that a single
    spi call takes a long while to process the query?

The former, I believe. One example (lightly obfuscated):

spi_exec -array a "SELECT this,that from table where stuff..." {
    if {$use_cancel_pending && [cancel_pending]} {
        error "cancelled in ..."
    }
    do_something_with_array a
    more_business_code_here
    and_so_on...
}


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pl/tcl function to detect when a request has been canceled
Следующее
От: Steve Atkins
Дата:
Сообщение: Compromised postgresql instances