Fix where command for pgsql