From: Richard Huxton <dev@archonet.com>
To: abief_ag_-postgresql@yahoo.com
Cc: pgsql-sql@postgresql.org
Subject: Re: session_id
Date: Wed, 17 Nov 2004 15:24:23 +0000
Message-ID: <419B6D27.5020804@archonet.com> (raw)
In-Reply-To: <20041117142525.97895.qmail@web13924.mail.yahoo.com>
References: <20041117142525.97895.qmail@web13924.mail.yahoo.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: dev@archonet.com, abief_ag_-postgresql@yahoo.com
Subject: Re: session_id
In-Reply-To: <419B6D27.5020804@archonet.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox