Re: [GENERAL] many updates to single row in single transaction

2005-07-09 Thread Dennis Bjorklund
On 8 Jul 2005, Adam Pritchard wrote: > so I have a singleton table that keeps track of where we are in the > pseudo-sequence. The table is very simple: > > CREATE TABLE t ( next BIGINT ); > INSERT INTO t ( next ) VALUES ( 0 ); > > UPDATE t SET next = $1; -- $1 = next+1 > > The problem is that

[GENERAL] many updates to single row in single transaction

2005-07-09 Thread Adam Pritchard
My application needs a counter that's guaranteed to not lose any values even in case of rollbacks (so sequences are out), so I have a singleton table that keeps track of where we are in the pseudo-sequence. The table is very simple: CREATE TABLE t ( next BIGINT ); INSERT INTO t ( next ) VALUES ( 0