Re: database session variables

From: "Mark Wilson" <mark(at)mediasculpt(dot)com>
To: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: database session variables
Date: 2002-10-02 01:48:46
Message-ID: 003301c269b5$dc10f0d0$3301a8c0@merl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks Martijin,

It sounds like the process_id is the 'correct' name for what I was calling
session_id, and is what I want. To answer your question, Oracle lets you
have session specific variables, via package variables.

Now the next step is how to get access to process_id. I am currently
running PostgreSQL version 7.2.1.

"select procpid from pg_stat_activity;" seems to return information for all
sessions (or 'processes').

Is backend_pid() or pg_stat_get_backend_pid() the correct call? Neither of
them seem to exist in my database. If they are correct, how do I install
them?

Thanks in advance,
Mark

----- Original Message -----
From: "Martijn van Oosterhout" <kleptog(at)svana(dot)org>
To: "Mark Wilson" <mark(at)mediasculpt(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Sent: Wednesday, October 02, 2002 11:49 AM
Subject: Re: [GENERAL] database session variables

> On Wed, Oct 02, 2002 at 10:27:10AM +1200, Mark Wilson wrote:
> > Hi all,
> >
> > I am working on a system architecture that requires accessing session
> > variables specific to the database connection. This is useful because
you
> > can emulate many users (with different privileges) with a single
database
> > logon. Currently it seems like only user, current_user and session_user
> > are supported.
>
> Well, you can get the process ID of the backend process. This would be
> different for every connection.
>
> What other database allow you to store session specific variables?
> --
> Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> > There are 10 kinds of people in the world, those that can do binary
> > arithmetic and those that can't.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gerhard Häring 2002-10-02 01:52:37 Re: PostgreSQL Website : advocacy.postgresql.org
Previous Message Nigel J. Andrews 2002-10-02 01:03:40 Re: Core Dump