Re: problem with serial - Mailing list pgsql-general

From Yvon Thoraval
Subject Re: problem with serial
Date
Msg-id CAG6bkBxhNCW2oBfAo+aVfzbTQrB=5fuGf=8Uf7S-h1N_LvANFQ@mail.gmail.com
Whole thread Raw
In response to Re: problem with serial  (Chris Angelico <rosuav@gmail.com>)
Responses Re: problem with serial  (Chris Angelico <rosuav@gmail.com>)
List pgsql-general


2012/4/19 Chris Angelico <rosuav@gmail.com>

As a side point, I would recommend against doing this. Once you've
"used" a rowid, it's not worth reusing it. You'll save yourself some
headaches down the track if you simply ignore those odd gaps (ditto
the gaps that result from rolled-back transactions) and just DELETE
the rows you're throwing out without bothering to setval the sequence
back.

Yes, for sure, however, i did this kind of workaround, because one time I've seen a rowid of 8, after an insertion even if the max(rowid) was of 42.



--
Yvon


pgsql-general by date:

Previous
From: Chris Angelico
Date:
Subject: Re: problem with serial
Next
From: Chris Angelico
Date:
Subject: Re: problem with serial