mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-12 09:27:04 +08:00
Allow referring to functions without arguments when unique
In DDL commands referring to an existing function, allow omitting the argument list if the function name is unique in its schema, per SQL standard. This uses the same logic that the regproc type uses for finding functions by name only. Reviewed-by: Michael Paquier <michael.paquier@gmail.com>
This commit is contained in:
@ -158,6 +158,14 @@ SELECT routine_name, ordinal_position, parameter_name, parameter_default
|
||||
|
||||
DROP FUNCTION functest_IS_1(int, int, text), functest_IS_2(int), functest_IS_3(int);
|
||||
|
||||
-- overload
|
||||
CREATE FUNCTION functest_B_2(bigint) RETURNS bool LANGUAGE 'sql'
|
||||
IMMUTABLE AS 'SELECT $1 > 0';
|
||||
|
||||
DROP FUNCTION functest_b_1;
|
||||
DROP FUNCTION functest_b_1; -- error, not found
|
||||
DROP FUNCTION functest_b_2; -- error, ambiguous
|
||||
|
||||
|
||||
-- Cleanups
|
||||
DROP SCHEMA temp_func_test CASCADE;
|
||||
|
||||
Reference in New Issue
Block a user