On Tuesday, August 28, 2018, PG Doc comments form <
noreply@postgresql.org> wrote:
postgres=# DECLARE
postgres-# key integer;
ERROR: syntax error at or near "integer"
LINE 2: key integer;
^
You are writing pl/psql language code at the SQL input prompt. That won't work. You have to either use the SQL DO command or write a function.
David J.