This is an error, which indicates, the command above had been fired in sql environment (like pgadmin offers it).
So use a terminal with a postgres client installation in place and fire your command.
Since I don’t know pgadmin 4, this information migth be incorrect and pgadmin 4 is also able to run such a command (by offering a console feature itself)
the sql-query-tool in pgadmin is for pure sql-commands, but your command is for the command shell to start psql, the command-line-interface for PostgreSQL. Please don’t just copy everything you find somewhere on the internet without understanding it. By the way, this is a German forum.