Serial (or autoincrement) fields don't guarantee sequential numbers - they
are only designed to provide a unique number.  So if your application
requires that each record have a numeric difference of 1, then you will need
to calculate the serial number and insert it into a record from within your
program.


-tom


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom D. Bullers - Network Engineer
University of Iowa Health Care
Telecommunications Services
mailto:[EMAIL PROTECTED]



> -----Original Message-----
> From: Doug Silver [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 20, 2002 4:04 PM
> To: [EMAIL PROTECTED]
> Subject: transaction rollback of sequences question 
> 
> 
> Hi All -
> 
> I'm just trying to confirm the perl DBI transaction/rollback feature,
> which works as expected except for one thing, one field that is SERIAL
> keeps incrementing, i.e. the sequence doesn't get rolled 
> back.  Does this
> mean I need to manually rollback (setval (current value-1))??
> 
> I tried both automatically inserting into the table and 
> manually getting
> the next value, but it doesn't matter.
> 
> I'm using perl 5.6, DBI-1.20, and DBD-Pg-1.01 (PostgreSQL).
> 
> Thanks!
> 
> (Please cc me directly as I'm not on this list)
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Doug Silver
> Network Manager
> Quantified Systems, Inc
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> 
> 

Reply via email to