PL/pgSQL should use `ELSIF`, not `ELSEIF`
See https://www.postgresql.org/docs/current/plpgsql-control-structures.html#PLPGSQL-CONDITIONALS, although it's possible both work with Postgres, not all PG-compatible DBs allow ELSEIF
. This specifically fails with CockroachDB.