dirty read from plpgsql

Поиск
Список
Период
Сортировка
От Willy-Bas Loos
Тема dirty read from plpgsql
Дата
Msg-id CAHnozTgBsXT7C+Dp6Jkymu8zaiG6EwtKo8Zj61O4ExA4NK4FNA@mail.gmail.com
обсуждение исходный текст
Ответы Re: dirty read from plpgsql  (Craig Ringer <craig@postnewspapers.com.au>)
Re: dirty read from plpgsql  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-general
I'd like to do a dirty read from plpgsql, so that i can stop the function that is in a long loop without rolling back the work that it did.
All i want to read is a flag that says 'stop'.
I've figured 2 ways of doing that, both of which i don't like very much.
* with a sequence: while value = nextval(seq)-1 loop  . To stop, run nextval(seq) from another session.
* with copy: run copy from within the function. To stop, overwrite the file that is to be copied into the function.

other than that, transaction safety prevents us from reading anything that is done after the function was called.
Any tips?

"use a different language" has occurred to me. It is an option, especially if there's no better way to stop plpgsql.

cheers,

WBL


--
"Patriotism is the conviction that your country is superior to all others because you were born in it." -- George Bernard Shaw

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

Предыдущее
От: Florian Weimer
Дата:
Сообщение: Generic terminal-based data browsing & entry
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: dirty read from plpgsql