mirror of
https://github.com/postgres/postgres.git
synced 2026-01-27 21:43:08 +03:00
Prefer argument name over "$n" for the refname of a plpgsql argument.
If a function argument has a name, use that as the "refname" of the PLpgSQL_datum representing the argument, instead of $n as before. This allows better error messages in some cases. Pavel Stehule, reviewed by Jeevan Chalke Discussion: https://postgr.es/m/CAFj8pRB9GyU2U1Sb2ssgP26DZ_yq-FYDfpvUvGQ=k4R=yOPVjg@mail.gmail.com
This commit is contained in:
@@ -4811,3 +4811,12 @@ BEGIN
|
||||
END; $$ LANGUAGE plpgsql;
|
||||
|
||||
SELECT * FROM list_partitioned_table() AS t;
|
||||
|
||||
--
|
||||
-- Check argument name is used instead of $n in error message
|
||||
--
|
||||
CREATE FUNCTION fx(x WSlot) RETURNS void AS $$
|
||||
BEGIN
|
||||
GET DIAGNOSTICS x = ROW_COUNT;
|
||||
RETURN;
|
||||
END; $$ LANGUAGE plpgsql;
|
||||
|
||||
Reference in New Issue
Block a user