Re: @@SPID MS SQL alternative - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: @@SPID MS SQL alternative
Date
Msg-id 20040416122729.GA31614@wolff.to
Whole thread Raw
In response to @@SPID MS SQL alternative  ("Jan Blaha" <jan.blaha@terminus.cz>)
List pgsql-novice
On Fri, Apr 16, 2004 at 11:09:00 +0200,
  Jan Blaha <jan.blaha@terminus.cz> wrote:
> Hi I am looking for some way how to get some ID variable that remains
> unchanged and unique throughout a connection, like MS SQL @@SPID. I am
> running PostGreSQL 7.2.1 Native Windows Port. I would be thanksfull for
> any help.

You could use a sequence to provide this. You will need to make an initial
call of nextval at the start of the session and then not call it again
(for the same sequence). Use currval to retrieve the id.

pgsql-novice by date:

Previous
From: "M. Bastin"
Date:
Subject: Eduphant 2.0
Next
From: Iandé Coutinho
Date:
Subject: Fw: triggers