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 E36FC3A3E44 for ; Wed, 17 Nov 2004 15:19:59 +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 01482-07 for ; Wed, 17 Nov 2004 15:19:50 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id CB6553A3C5D for ; Wed, 17 Nov 2004 15:19:53 +0000 (GMT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.1/8.13.1) with ESMTP id iAHFJekh002689 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Nov 2004 08:19:43 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.1/8.13.1) with ESMTP id iAHFJdn6004120; Wed, 17 Nov 2004 08:19:39 -0700 (MST) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.1/8.13.1/Submit) id iAHFJdc6004119; Wed, 17 Nov 2004 08:19:39 -0700 (MST) (envelope-from mfuhr) Date: Wed, 17 Nov 2004 08:19:39 -0700 From: Michael Fuhr To: "Riccardo G. Facchini" Cc: Richard Huxton , pgsql-sql@postgresql.org Subject: Re: session_id Message-ID: <20041117151939.GA4078@winnie.fuhr.org> References: <419B56CC.8090703@archonet.com> <20041117142525.97895.qmail@web13924.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041117142525.97895.qmail@web13924.mail.yahoo.com> 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/176 X-Sequence-Number: 19495 On Wed, Nov 17, 2004 at 06:25:25AM -0800, Riccardo G. Facchini wrote: > > --- Richard Huxton <__> wrote: > > > > Add a new sequence to your database: [snip] > 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. Where did you get the idea that currval() would be affected by other sessions? Richard mentioned that sequences are concurrency-safe, as does the documentation. http://www.postgresql.org/docs/7.4/static/functions-sequence.html Can you give us an example of where this wouldn't work? -- Michael Fuhr http://www.fuhr.org/~mfuhr/