X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 878CC3A3EEC for ; Wed, 17 Nov 2004 15:04:39 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98089-01 for ; Wed, 17 Nov 2004 15:04:28 +0000 (GMT) Received: from web13911.mail.yahoo.com (web13911.mail.yahoo.com [216.136.174.59]) by svr1.postgresql.org (Postfix) with SMTP id 618AA3A3F53 for ; Wed, 17 Nov 2004 15:04:26 +0000 (GMT) Received: (qmail 3480 invoked by uid 60001); 17 Nov 2004 15:04:26 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=QTUQqev01sqIYZk/eohw2wERtH4DVgy8NV1r4GvD5o/WQXb8NDzVo2Hbt9vlOArTcVJLlj3eHxoQcPPXZuvwkcITeQnIKIovHYqkod6JyE4WFtoEmithDOYezdqtxsl+WSUlh2V+i+YW5tyNMWN2Ej+L16eK3MWDyHH/awuC0Rs= ; Message-ID: <20041117150426.3478.qmail@web13911.mail.yahoo.com> Received: from [80.67.100.162] by web13911.mail.yahoo.com via HTTP; Wed, 17 Nov 2004 07:04:26 PST Date: Wed, 17 Nov 2004 07:04:26 -0800 (PST) From: "Riccardo G. Facchini" Reply-To: abief_ag_-postgresql@yahoo.com Subject: Re: session_id To: Richard Huxton , Achilleus Mantzios Cc: abief_ag_-postgresql@yahoo.com, pgsql-sql@postgresql.org In-Reply-To: <419B63E3.5040900@archonet.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/175 X-Sequence-Number: 19494 --- 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