postgres filter bug fix