An explicit JOIN isn't supported within an UPDATE statement on the Postgresql platform, SQLAlchemy supports "UPDATE..FROM" but you need to set up the join condition as an "implicit join", which is what "mark_type_read2" is essentially doing, establishing the equality between Event and Notification directly.
If you need to UPDATE against an actual "outer" join, you'd need to turn it into a correlated subquery in the WHERE clause of the UPDATE statement. On May 9, 2013, at 6:11 AM, Tobias Bieniek <tobias.bien...@googlemail.com> wrote: > Hi guys, > > I have stripped down my problematic code to the following: > http://pastebin.com/AvvEr103 > > I am trying to call the Query.update() method on a query that is using an > innerjoin to load some more information that I use in a filter. If I use the > same expression to query data everything works fine, but once I call update() > the join expression (Event.id == Notification.event_id) is no longer taken > into account and the update() call updates all the rows in the table. I'm > having the feeling that this might actually be a bug in SQLAlchemy. As you > can see there is a workaround by simply adding the expression explicitly as a > filter, but it would obviously be better to have this be the default > behaviour. > > Turbo > > -- > You received this message because you are subscribed to the Google Groups > "sqlalchemy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy?hl=en. For more options, visit https://groups.google.com/groups/opt_out.