I want to write a contrib module that exports a couple of functions
that PLs (that don't natively support this) can use to set/get
session-local variables. I have a couple of questions:
- Can I simply use a global variable for my hash? Am I correct in
thinking that stored procedures and functions will be executed in the
postgres process assigned to the connection that invokes them, and
therefore each will have its own copy of the global variable?
- How can I get a session-scoped MemoryContext to allocate nodes out of?
Thanks,
Nick Johnson