tag:blogger.com,1999:blog-8839574367290288724.post3778164289343566167..comments2023-12-11T13:13:11.330-08:00Comments on Pavel Stehule's blog: Run PLpgSQL function before loginPavel Stěhulehttp://www.blogger.com/profile/01996484227228696817noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-8839574367290288724.post-41744249698415930462015-11-16T12:36:03.045-08:002015-11-16T12:36:03.045-08:00I have in fact gotten this to work for initializin...I have in fact gotten this to work for initializing the plpythonu interpreter per session, including activating a virtualenv. I'll fire a PR at you for two things: back ported to build on > 9.0, since it can use the local_preload_libraries setting (not quite as convenient as setting session_preload_libraries on a per database basis, but still works) and I'm going to suggest renaming the variable from login_name to function_name, since it's really a per session exec of an arbitrary function. This leads to the rather nice IMHO setting name 'session_exec.function_name', which I think fairly clearly specifies 'name of function to execute at session start' login_name seems to me to be something about the username used to login, by contrast.Ross Reedstromhttps://www.blogger.com/profile/05592010675819388393noreply@blogger.comtag:blogger.com,1999:blog-8839574367290288724.post-10871175413309224582015-09-28T14:40:49.844-07:002015-09-28T14:40:49.844-07:00Looks useful - I've been looking for a way to ...Looks useful - I've been looking for a way to run a specific function to configure the plpython interpreter on a per-database basis (enabling using diff. virtualenv setups) this looks like it will do the trick.Ross Reedstromhttps://www.blogger.com/profile/05592010675819388393noreply@blogger.com