plpgsql: fix parsing of integer range with underscores
Erik Wienhold <ewie@ewie.name>
From: Erik Wienhold <ewie@ewie.name>
To: pgsql-hackers@postgresql.org
Date: 2024-05-15T01:14:36Z
Lists: pgsql-hackers
Attachments
plpgsql fails to parse 1_000..1_000 as 1000..1000 in FOR loops:
DO $$
DECLARE
i int;
BEGIN
FOR i IN 1_000..1_000 LOOP
END LOOP;
END $$;
ERROR: syntax error at or near "1_000."
LINE 5: FOR i IN 1_000..1_000 LOOP
The scan.l defines rule "numericfail" to handle this ambiguity without
requiring extra whitespace or parenthesis around the integer literals.
But the rule only accepts digits 0-9. Again, an oversight in
faff8f8e47. Fixed in the attached patch.
--
Erik
Commits
-
Fix PL/pgSQL's handling of integer ranges containing underscores.
- b4e909082fa1 16.4 landed
- cd2624fd97b0 17.0 landed