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

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Functions, savepoints, autocommit = I am confused !
Дата
Msg-id 558D6D1C.3070100@aklaver.com
обсуждение исходный текст
Ответ на Re: Functions, savepoints, autocommit = I am confused !  (Tim Smith <randomdev4+postgres@gmail.com>)
Ответы Re: Functions, savepoints, autocommit = I am confused !  (Tim Smith <randomdev4+postgres@gmail.com>)
Список pgsql-general
On 06/26/2015 07:24 AM, Tim Smith wrote:
>> So this is in a plpgsql function?
>
> It is yes, but I thought I would spare you a copy/paste of the entire thing.
>
> The error trapping section currently looks like this :
> EXCEPTION
>                          WHEN OTHERS THEN
>                                  RAISE EXCEPTION 'Failed to validate
> session for session % (SQLSTATE: %  - SQLERRM: %)',
> session_id,SQLSTATE,SQLERRM
>                                  USING HINT = 'Database error occured
> (sval fail)';
> END;
>
>>
>> Where is the validateSession function?
>>
>> More to the point, can you show how it is used in conjunction with?
>>
>
> The validateSession function was the one I pasted ?  Do you mean you
> want to see the actual function() definition at the top ?
>
> The cleanSession function (the one validateSession calls at the top)

Well what you showed before was cleanSessionTable, are we talking the
same thing?

> is simple (the v_ values are simply 'epoch minus TTL') :
> BEGIN
> delete from app_security.app_sessions where
> session_start<=v_forcedTimeout or
> session_lastactive<=v_sessionTimeout;
> EXCEPTION
> WHEN OTHERS THEN
> RAISE EXCEPTION
> USING ERRCODE = sqlstate,
> MESSAGE = 'Failed to clean session table (' || sqlerrm || ')',
> HINT = 'Database error(sclean fail)';
> END;
> $$ LANGUAGE plpgsql;
>
>>
>> See the plpgsql link above.
>
>
> Will take a look at the link.  Thanks !
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Functions, savepoints, autocommit = I am confused !
Следующее
От: Tim Smith
Дата:
Сообщение: Re: Functions, savepoints, autocommit = I am confused !