Skip site navigation (1) Skip section navigation (2)

Re: session_id

From: "Riccardo G(dot) Facchini" <abief_ag_-postgresql(at)yahoo(dot)com>
To: Richard Huxton <dev(at)archonet(dot)com>,Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
Cc: abief_ag_-postgresql(at)yahoo(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: session_id
Date: 2004-11-17 15:04:26
Message-ID: 20041117150426.3478.qmail@web13911.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-sql
--- Richard Huxton <__> wrote:

> Achilleus Mantzios wrote:
> > O Richard Huxton   Nov 17, 2004 :
> > 
> > 
> >>Riccardo G. Facchini wrote:
> >>
> >>>hi all,
> >>>
> >>>is there a way to determine the session id on a database session?
> >>>
> >>>I would need to have a unique number whenever a session is
> started, and
> >>>have this available as a function or view result.
> > 
> > 
> > Why not SELECT pg_backend_pid();
> > ??
> 
> This is guaranteed to be unique while connected, but if you want to 
> track sessions over time isn't guaranteed to be. So, if you might
> have 
> pid=1234 now and also a month ago in a different session (especially
> if 
> you had a server reboot in-between).
> 
> Of course, if Riccardo doesn't need that, the pid is fine.
> 
> --
>    Richard Huxton
>    Archonet Ltd
> 

Ok. Taken note.

No. I don't need that, as I only need it during the session itself.
Once ended, the session info is not required over time.

thanks to all for your suggestions,

Riccardo

In response to

pgsql-sql by date

Next:From: Michael FuhrDate: 2004-11-17 15:19:39
Subject: Re: session_id
Previous:From: Stephan SzaboDate: 2004-11-17 14:52:54
Subject: Re: Counting Distinct Records

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group