Re: [GENERAL] Session variables and C functions

2011-11-17 Thread Ivan Voras
On 18 November 2011 01:20, Tom Lane wrote: > Ivan Voras writes: >> Is there any way to make _PG_init() called earlier, e.g. as soon as >> the session is established or at database connection time, something >> like that? > > Preload the library --- see shared/local_preload_libraries configuration

Re: [GENERAL] Session variables and C functions

2011-11-17 Thread Tom Lane
Ivan Voras writes: > Is there any way to make _PG_init() called earlier, e.g. as soon as > the session is established or at database connection time, something > like that? Preload the library --- see shared/local_preload_libraries configuration settings. regards, tom lan

Re: [GENERAL] Session variables and C functions

2011-11-17 Thread Ivan Voras
On 17 November 2011 19:02, Tom Lane wrote: > Ivan Voras writes: >> Ideally, the C module would create its own "custom variable class," >> named e.g. "module", then define some setting, e.g. "module.setting". >> The users would then execute an SQL command such as "SET SESSION >> module.setting='so

Re: [GENERAL] Session variables and C functions

2011-11-17 Thread Tom Lane
Ivan Voras writes: > Ideally, the C module would create its own "custom variable class," > named e.g. "module", then define some setting, e.g. "module.setting". > The users would then execute an SQL command such as "SET SESSION > module.setting='something'", and the module would need to pick this

[GENERAL] Session variables and C functions

2011-11-17 Thread Ivan Voras
I'm writing a custom C function and one of the things it needs to do is to be configured from the SQL-land, per user session (different users have different configurations in different sessions). I have found (and have used) the SET SESSION command and the current_setting() function for use with c