fix issue with update_all and inner joins with pg

Guys can someone provide feedback on this fix? Thanks in advance
cc @robin850 @rafaelfranca @such
You mean SQlite