On Thu, Oct 4, 2012 at 6:12 AM, Ivan Voras <ivo...@freebsd.org> wrote:

> On 01/10/2012 15:36, Moshe Jacobson wrote:
> > I am working on an audit logging trigger that gets called for every row
> > inserted, updated or deleted on any table.
> > For this, I need to store a couple of temporary session variables such as
> > the ID of the user performing the change, which can be set at the start
> of
> > the session.
>
> Do you know about session variables?
> The major benefit here is that it doesn't touch the table engines,
> temporary or not.
>

This sounds incredibly useful. Why have I not heard of this until today??
In your example you still had to use a BEGIN...EXCEPTION block. Is that
faster than a create temp table?

-- 
Moshe Jacobson
Nead Werx, Inc. | Senior Systems Engineer
2323 Cumberland Parkway, Suite 201 | Atlanta, GA 30339
mo...@neadwerx.com | www.neadwerx.com

Reply via email to