Re: [sqlalchemy] query.delete(fetch) gets confused by aliased

2016-02-02 Thread Rick Otten
No problem. It makes sense now. Adding aliased before I did anything with a sqlalchemy query had become sort of a programming pattern and I wasn't thinking any more at that time about what happens when the alias gets translated into a SQL DELETE statement and how that wouldn't work anyhow. To im

Re: [sqlalchemy] query.delete(fetch) gets confused by aliased

2016-02-02 Thread Mike Bayer
On 02/02/2016 09:05 AM, Rick Otten wrote: > However, when the fetch query actually runs, it includes the non aliased > table name as well as the aliased table name in the from statement: > > select t.idfrom *some_table, some_table as t* w

Re: [sqlalchemy] query.delete(fetch) gets confused by aliased

2016-02-02 Thread Rick Otten
> > >> > However, when the fetch query actually runs, it includes the non aliased >> > table name as well as the aliased table name in the from statement: >> > >> > select t.idfrom *some_table, some_table as t* where t.some_column = >> > /someValue/ >> >> well that's not a DELETE statement

Re: [sqlalchemy] query.delete(fetch) gets confused by aliased

2016-02-01 Thread Mike Bayer
On 02/01/2016 11:18 AM, Rick Otten wrote: When I used "aliased" with query.delete(), the fetch query seems to get confused. * I'm using SQLAlchemy 1.0.11, which 'pip' tells me is the latest version. * My backend database is PostgreSQL 9.5 Code snippet: | fromsqlalchemy.orm importaliase