On Mar 20, 2007, at 11:15 PM, 张骏 wrote:

>
>> postgres.py:
> Added SAVEPOINT support.
> without SAVEPOINT support, the next code cannot run:
> ::python
>       
>       rs = con.execute( "select * from sometable1" )
>       for row in rs:
>               a = row.a
>               try:
>                       con.execute( "insert into sometable2( a ) values( %s )" 
> , ( a ) )
>               except:
>                       pass
>
> with SAVEPOINT support:
> ::python
>       rs = con.execute( "select * from sometable1" )
>       for row in rs:
>               a = row.a
>               try:
>                       con.execute( "insert into sometable2( a ) values( %s )" 
> , ( a ) )
>               except:
>                       if con.engine.name == 'postgres':
>                               con.execute( 'rollback to sp' )

so, youd just have people using postgres automatically and without  
any control issue a "SAVEPOINT SP" after every single statement  
execution ?  what about the performance overhead ?  what if someone  
wants to issue SAVEPOINT at some other step, or not at all ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to