'Session local' variables - Mailing list pgsql-general

From Nick Johnson
Subject 'Session local' variables
Date
Msg-id a01fc5d10707012116t350fd88bp6cc0926669addc4@mail.gmail.com
Whole thread Raw
Responses Re: 'Session local' variables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: shmctl EIDRM preventing startup
Next
From: "Jason L. Buberel"
Date:
Subject: recovery_target_time ignored or recovery always recovers to end of WAL