[sqlalchemy] 2 transactions for one

2010-06-06 Thread marco vaccari
This script lock in the update statement following select for update: eng=sqlalchemy.create_engine('postgres://x.loc/db') metadata=sqlalchemy.MetaData() metadata.bind=eng tab1 = Table('tab1', metadata, autoload=True) a_rec = tab1.select( for_update=True

[sqlalchemy] Re: inner join and ambiguous columns

2010-03-22 Thread marco vaccari
Sorry. I speak english in rare occasions. No. It is not an insert into a join. The result of a join between tables A and B is the VALUES partial set for an insert into table C. sql = A.join(B).select(A.c.id == an_id, fold_equivalents=True, use_labels=False) rec = sql.execute().fetchone()

[sqlalchemy] inner join and ambiguous columns

2010-03-19 Thread marco vaccari
no more correspond to the originals and then to the table C columns labels. I am new to sqlalchemy. Is there a better solution ? Can I avoid fold_equivalents in this case? Thanks! Marco Vaccari -- You received this message because you are subscribed to the Google Groups sqlalchemy group

[sqlalchemy] Re: inner join and ambiguous columns

2010-03-19 Thread marco vaccari
Opsss! dict(zip(record.keys(), record.items()) must be dict(record.items()) On 19 Mar, 16:23, marco vaccari agat...@gmail.com wrote: Consider 3 tables A,B,C A JOIN B ON A.id = B.id produce all the columns required for an insert into C. I can write: C.insert().values(dict(zip(record.keys