'Session local' variables

From: "Nick Johnson" <arachnid(at)notdot(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: 'Session local' variables
Date: 2007-07-02 04:16:01
Message-ID: a01fc5d10707012116t350fd88bp6cc0926669addc4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jason L. Buberel 2007-07-02 04:41:46 recovery_target_time ignored or recovery always recovers to end of WAL
Previous Message Michael Fuhr 2007-07-02 02:58:33 Re: shmctl EIDRM preventing startup