[Rt-devel] Postgres performance issues and some "odd" ways to
	get	IDs...
    Andrew Sullivan 
    ajs at crankycanuck.ca
       
    Mon Aug 14 13:14:05 EDT 2006
    
    
  
On Mon, Aug 14, 2006 at 10:03:36AM -0700, Joby Walker wrote:
> Jesse,
> 
> The new behavior seems very broken:
> 
> 1) Insert row (sequence nextval returns x)
> 2) get current value of sequence (returns x)
> 
> As far as I can see SearchBuilder doesn't wrap a transaction around the 
> Insert sub so you could end up with unpredictable results:
No, you can't, even without explicit BEGIN;  . . . COMMIT;  Please
see the Postgres docs on nextval() an currval().  But the basic thing
is that currval() is private to _your connection_, not to your
transaction.
A
-- 
Andrew Sullivan  | ajs at crankycanuck.ca
Information security isn't a technological problem.  It's an economics
problem.
		--Bruce Schneier
    
    
More information about the Rt-devel
mailing list