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 B178D3A4070 for ; Wed, 17 Nov 2004 15:24:31 +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 05763-01 for ; Wed, 17 Nov 2004 15:24:22 +0000 (GMT) Received: from anchor-post-31.mail.demon.net (anchor-post-31.mail.demon.net [194.217.242.89]) by svr1.postgresql.org (Postfix) with ESMTP id 4E9013A4053 for ; Wed, 17 Nov 2004 15:24:25 +0000 (GMT) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-31.mail.demon.net with esmtp (Exim 4.42) id 1CURfi-0004Ia-48; Wed, 17 Nov 2004 15:24:38 +0000 Received: from [192.168.1.17] (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 397E717357; Wed, 17 Nov 2004 15:24:24 +0000 (GMT) Message-ID: <419B6D27.5020804@archonet.com> Date: Wed, 17 Nov 2004 15:24:23 +0000 From: Richard Huxton User-Agent: Mozilla Thunderbird 0.9 (X11/20041103) X-Accept-Language: en-us, en MIME-Version: 1.0 To: abief_ag_-postgresql@yahoo.com Cc: pgsql-sql@postgresql.org Subject: Re: session_id References: <20041117142525.97895.qmail@web13924.mail.yahoo.com> In-Reply-To: <20041117142525.97895.qmail@web13924.mail.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/177 X-Sequence-Number: 19496 Riccardo G. Facchini wrote: >>Add a new sequence to your database: >> CREATE SEQUENCE my_session_id; >> >>Then, at the start of every session: >> SELECT nextval('my_session_id'); >> >>and whenever you need the value: >> SELECT currval('my_session_id'); > Good idea, but it won't work for what I need. > I'll be able to do get the nextval('my_session_id') as soon as the > session initiates, but my problem is that I need to make all the > subsecuent actions aware of that particular value. using > currval('my_session_id') is not good, as any other session is likely to > also change my_session_id to another value. No - other sessions will see different values. Test it and see. -- Richard Huxton Archonet Ltd