Re: [GENERAL] Sequences

From: Anand Surelia <anand(at)bytekinc(dot)com>
To: Fran Fabrizio <fran(at)primary(dot)net>
Cc: "pgsql-general(at)postgreSQL(dot)org" <pgsql-general(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] Sequences
Date: 1998-10-20 23:52:44
Message-ID: 362D224C.E29770@bytekinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Exactly. I want to do the same thing, but don't know of any better way. Can
you check the tuple which has just been inserted?
Thanks,
Anand

Fran Fabrizio wrote:

> Correct me if I am wrong, but you are inserting the value of this sequence
> into a table for the transaction you've just processed, right? So instead
> of accessing the current value of the sequence, can't you just access the
> transaction number that got insterted into the table?
>
> At 04:15 PM 10/20/98 -0700, you wrote:
> >Hi All,
> >I am using a sequence to automatically generate a transaction number in
> >my database. I've set up the transaction number to have a default value
> >from the sequence, so that I don't have to provide a number while
> >entering. However, I want to know the number of the transaction I've
> >just entered. I can do that by calling curval(sequence), but in a
> >dynamic situation with lot of transactions being recorded by multiple
> >users, how can I be sure I am getting the value which I had entered.
> >It sounds silly, but I am sure there is a simple solution for it. Do I
> >have to lock the sequence while I am using so that no one else can use
> >it, or do I fire both the queries in the same TRANSACTION block?
> >Thanks for any help,
> >Anand.
> >
> >
> >

Browse pgsql-general by date

  From Date Subject
Next Message Anand Surelia 1998-10-21 00:45:06 SPI Insert
Previous Message Anand Surelia 1998-10-20 23:15:03 Sequences