[sqlalchemy] execute at beginning of every session

2011-02-16 Thread Landreville
Hi, I am trying to set a session variable (call a function with a value) in postgres at the beginning of every session that SQLAlchemy starts. I'm using the session variable to specify the currently logged in user for an auditing system (just a trigger on a couple tables). I have tried the

Re: [sqlalchemy] execute at beginning of every session

2011-02-16 Thread Jon Nelson
On Wed, Feb 16, 2011 at 9:22 AM, Landreville ja...@deadtreepages.com wrote: Hi, I am trying to set a session variable (call a function with a value) in postgres at the beginning of every session that SQLAlchemy starts. I'm using the session variable to specify the currently logged in user for

Re: [sqlalchemy] execute at beginning of every session

2011-02-16 Thread Michael Bayer
On Feb 16, 2011, at 10:22 AM, Landreville wrote: Hi, I am trying to set a session variable (call a function with a value) in postgres at the beginning of every session that SQLAlchemy starts. I'm using the session variable to specify the currently logged in user for an auditing system (just

Re: [sqlalchemy] execute at beginning of every session

2011-02-16 Thread Jon Nelson
On Wed, Feb 16, 2011 at 10:51 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Feb 16, 2011, at 10:22 AM, Landreville wrote: Hi, I am trying to set a session variable (call a function with a value) in postgres at the beginning of every session that SQLAlchemy starts. I'm using the

Re: [sqlalchemy] execute at beginning of every session

2011-02-16 Thread Michael Bayer
On Feb 16, 2011, at 12:54 PM, Jon Nelson wrote: On Wed, Feb 16, 2011 at 10:51 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Feb 16, 2011, at 10:22 AM, Landreville wrote: Hi, I am trying to set a session variable (call a function with a value) in postgres at the beginning of

Re: [sqlalchemy] execute at beginning of every session

2011-02-16 Thread Jon Nelson
On Wed, Feb 16, 2011 at 12:15 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Feb 16, 2011, at 12:54 PM, Jon Nelson wrote: On Wed, Feb 16, 2011 at 10:51 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Feb 16, 2011, at 10:22 AM, Landreville wrote: Hi, I am trying to set a

Re: [sqlalchemy] execute at beginning of every session

2011-02-16 Thread Jason McKellar
On Wed, Feb 16, 2011 at 11:51 AM, Michael Bayer mike...@zzzcomputing.comwrote: On Feb 16, 2011, at 10:22 AM, Landreville wrote: Is there a way to run a command at the beginning of every session, before anything else is run? SessionExtension has an after_begin() hook for this purpose.

Re: [sqlalchemy] execute at beginning of every session

2011-02-16 Thread Michael Bayer
On Feb 16, 2011, at 4:18 PM, Jason McKellar wrote: On Wed, Feb 16, 2011 at 11:51 AM, Michael Bayer mike...@zzzcomputing.com wrote: On Feb 16, 2011, at 10:22 AM, Landreville wrote: Is there a way to run a command at the beginning of every session, before anything else is run?