tom(dot)darci(at)gmail(dot)com writes:
> My troubles would be solved if I could reference a SessionID from
> within PG. Any hope?
Create a sequence. At session start, nextval() it to assign a session
ID for your session. Then currval() returns your session ID whenever
you need it.
regards, tom lane