Re: @@SPID MS SQL alternative

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Jan Blaha <jan(dot)blaha(at)terminus(dot)cz>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: @@SPID MS SQL alternative
Date: 2004-04-16 12:27:29
Message-ID: 20040416122729.GA31614@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, Apr 16, 2004 at 11:09:00 +0200,
Jan Blaha <jan(dot)blaha(at)terminus(dot)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.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Iandé Coutinho 2004-04-16 13:17:16 Fw: triggers
Previous Message M. Bastin 2004-04-16 10:53:22 Eduphant 2.0