On Mon, 24 Nov 2003 12:48:26 -0300 (ART)
MaRcElO PeReIrA <gandalf_mp@yahoo.com.br> wrote:
> The biggest problem it that I *can't* have holes in
> that column, so it was because I used id (serial) and
> forn_id (integer).
>
Well, if you cannot use a sequence you will have no choice but to use
locking.
don't use max - it isn't fast on PG use select forn_id from thetable
order by fornid desc limit 1. You'll need an index on forn_id or
performance will suffer.
--
Jeff Trout <jeff@jefftrout.com>
http://www.jefftrout.com/http://www.stuarthamm.net/