Why I get error in DO$$ - END$$ statement in Postgres

I get error:

pq: syntax error at or near “DO”

My simple statement:

DO $$
DECLARE
  _iter int;
BEGIN
  _iter:= -1;
  /* some logic */
END
$$;

PS: I commented out the logic to understand what the problem is