Variables names in PL/pgSQL are meant to be case-insensitive unless surrounded by double quotes, just like identifiers in SQL. However, this is currently not the case when the variable is used as the target of an INTO clause for a SQL exec statement or FETCH statement:
root@localhost:26257/defaultdb> CREATE PROCEDURE p() LANGUAGE PLpgSQL AS $$ DECLARE foo INT; BEGIN SELECT 1 INTO FOO; END $$;
ERROR: "FOO" is not a known variable
SQLSTATE: 42601
We should ensure that PL/pgSQL variables have correct casing behavior in all contexts.
Variables names in PL/pgSQL are meant to be case-insensitive unless surrounded by double quotes, just like identifiers in SQL. However, this is currently not the case when the variable is used as the target of an INTO clause for a SQL exec statement or FETCH statement:
We should ensure that PL/pgSQL variables have correct casing behavior in all contexts.
Jira issue: CRDB-40753