SessionID, pretty please

From: tom(dot)darci(at)gmail(dot)com
To: pgsql-general(at)postgresql(dot)org
Subject: SessionID, pretty please
Date: 2006-06-07 20:21:16
Message-ID: 1149711676.382798.146420@g10g2000cwb.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello All-

I am in the process of replacing the backend for a large MS Access
project with PG.

I really could use a Session ID. I would like to create a view like
this:

CREATE VIEW mysettings
AS
SELECT * FROM mysettingstable
WHERE sessionidcolumn = CURRENTSESSIONID()

It is essential that we be able to reference a session id without
passing it in, as this has to work within the "linked table" paradigm
of Access and a lot of Access forms that have already been developed.

The TEMPORARY TABLE feature of PG seemed ideal for these purposes.
However, after burning many many days on 2 different attempts at
solving this using temp tables (first attempt used temp tables, second
attempt tried to use the name of the current temp schema as a unique
session id), I'm at my wits end, as I can't get this to work reliably
with Access and its linked tables...

I see that the log_line_prefix can be set to a Session ID (using
'%c'). Is there any way to get the current value of this from a
function in PG? (current_setting() simply returns the configuration
string, not its actual value.)

My troubles would be solved if I could reference a SessionID from
within PG. Any hope?

THANKS,
-Tom

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2006-06-07 20:34:23 Re: GPL Licensed Files in 8.1.4
Previous Message Tom Lane 2006-06-07 19:51:33 Re: GPL Licensed Files in 8.1.4