Session variables and C functions - Mailing list pgsql-general

From Ivan Voras
Subject Session variables and C functions
Date
Msg-id ja3efm$kbh$1@dough.gmane.org
Whole thread Raw
Responses Re: Session variables and C functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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?



Attachment

pgsql-general by date:

Previous
From: "Tomas Vondra"
Date:
Subject: Re: monitoring sql queries
Next
From: Scott Mead
Date:
Subject: Re: monitoring sql queries