Postgresql Window Function Count Python String Replace A Backslash