On Nov 10, 2008, at 8:37 AM, paftek wrote:

>
> Hi,
>
> I am using SQLAlchemy with PostgreSQL 8.3.
> Today I just discovered the great "postgres_returning" functionnality.
>
> Dumb question :
> Is it possible to take advantage of it in session mode ? In other
> words, is it possible for session.add() to issue only one "INSERT
> INTO ... RETURNING ..." query instead of two ("INSERT" then "SELECT"),
> like in the following example :

this is an enhancement that we'll be pursuing in the near future.    
Jason was having problems getting INSERT RETURNING to work at all with  
pg 8.3 the other day for some reason.

the exact functionality will be that the PG dialect uses INSERT  
RETURNING by default in all cases where right now it executes a  
sequence beforehand.   This means that if you issue an insert() using  
PG, no explicitness will be needed in order to get new defaults or  
primary key values back.  A dialect flag  
"use_returing_on_inserts=True" will allow control over the feature at  
the configurational level.   The ORM wont be aware of it explicitly.



--~--~---------~--~----~------------~-------~--~----~
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