Serial numbers

From: Marcus Better <marcusb(at)matematik(dot)su(dot)se>
To: pgsql-sql(at)postgresql(dot)org
Subject: Serial numbers
Date: 1999-01-28 09:12:56
Message-ID: 14000.10525.469359.464174@unreal.matematik.su.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Herouth Maoz writes:

> So, the inserts for the ccats table become:
>
> INSERT INTO ccats (cid, catid) VALUES (currval( 'name of seq' ), 5 );

What if someone does another INSERT between the two INSERTs, then the
number generator is stepped and the second table gets the wrong serial
number. Should one use LOCK here?

Marcus

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Vadim Mikheev 1999-01-28 09:30:58 Re: [SQL] Serial numbers
Previous Message Remigiusz Sokolowski 1999-01-28 07:34:43 Re: [SQL] Is any quick help to SQL functions?