Postgresql Window Function Count Python String Find Not Working