Serial numbers - Mailing list pgsql-sql

From Marcus Better
Subject Serial numbers
Date
Msg-id 14000.10525.469359.464174@unreal.matematik.su.se
Whole thread Raw
List 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

pgsql-sql by date:

Previous
From: Remigiusz Sokolowski
Date:
Subject: Re: [SQL] Is any quick help to SQL functions?
Next
From: Vadim Mikheev
Date:
Subject: Re: [SQL] Serial numbers