PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> Formally, the INTO should always precede the FROM keyword in a SELECT INTO
> statement. ( https://www.postgresql.org/docs/12/sql-selectinto.html )
That is not the appropriate reference for plpgsql's version of
SELECT INTO. You should be reading
https://www.postgresql.org/docs/12/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW
which explains plpgsql's rules for where to put INTO.
regards, tom lane