Re: database session variables - Mailing list pgsql-general

From Steve Atkins
Subject Re: database session variables
Date
Msg-id 20021001194531.A17767@blighty.com
Whole thread Raw
In response to Re: database session variables  ("Mark Wilson" <mark@mediasculpt.com>)
Responses Re: database session variables  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
On Wed, Oct 02, 2002 at 01:48:46PM +1200, Mark Wilson wrote:
> 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?

Take a look at contrib/miscutil - the C module there gives you the
SQL function  backend_pid().

Cheers,
  Steve

pgsql-general by date:

Previous
From: Justin Clift
Date:
Subject: Re: PostgreSQL Website : advocacy.postgresql.org
Next
From: Mike Mascari
Date:
Subject: Re: database session variables