Session variables and C functions

Поиск
Список
Период
Сортировка
От Ivan Voras
Тема Session variables and C functions
Дата
Msg-id ja3efm$kbh$1@dough.gmane.org
обсуждение исходный текст
Ответы Re: Session variables and C functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
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 custom_variable_classes
configuration in postgresql.conf, but I'm not sure how to achieve the
same effect from C.

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 up
in the C function.

Any pointers to how this would be done?



Вложения

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

Предыдущее
От: "Tomas Vondra"
Дата:
Сообщение: Re: monitoring sql queries
Следующее
От: Scott Mead
Дата:
Сообщение: Re: monitoring sql queries