Re: Functions, savepoints, autocommit = I am confused !

Поиск
Список
Период
Сортировка
От Tim Smith
Тема Re: Functions, savepoints, autocommit = I am confused !
Дата
Msg-id CA+HuS5GufJcgPdJHPQJP2LzCEf4DWrTbkHC-EwB38ZRDqoPRWg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Functions, savepoints, autocommit = I am confused !  (Adrian Klaver <adrian.klaver@aklaver.com>)
Ответы Re: Functions, savepoints, autocommit = I am confused !  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Adrian,

"what I want" is quite simple, I want the function to work as intended.  ;-)

Let's step through the function :

(1) perform app_security.cleanSessionTable(p_forcedTimeout,p_sessionTimeout);

Function calls cleanSessionTable.    cleanSessionTable is simple.  It
calls DELETE on the session table using epochs as filters.    That's
fine, it works, I've tested that function.

The reason I want cleanSessionTable called here is because this is the
back-end to a web app.  This function is called "validateSession",
hence it needs to do what it says on the tin and make sure expired
sessions are not validated.

The problem happens next ....

(2) select * into strict v_row  .etc

IF cleanSessionTable deleted the row, then this select will fail.
Which is fine ... EXCEPT for the fact that Postgresql will then
roll-back the good work it did on the previous statement
(cleanSessionTable).

I want the deleted session rows to remain deleted.  I don't want them back.


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Functions, savepoints, autocommit = I am confused !
Следующее
От: Filip Rembiałkowski
Дата:
Сообщение: Foreign data wrappers and indexes on remote side