Re: Identifying function-lookup failures due to argument name mismatches

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Chao Li <li.evan.chao@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dominique Devienne <ddevienne@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2025-08-27T15:42:50Z
Lists: pgsql-hackers
On 25.08.25 04:43, Chao Li wrote:
> Can we avoid the duplication in a way like:
> 
> ```
> static int
> func_lookup_failure_details(int fgc_flags, List *argnames, bool proc_call)
> {
> 	const char *func_kind = proc_call ? "procedure" : "function";
> 
> 	/*
> 	if (proc_call)
> 		return errdetail("There is no procedure of that name.");
> 	else
> 		return errdetail("There is no function of that name.");
> 	*/
> 	return errdetail("There is no %s of that name.", func_kind);
> ```

No, see here: 
https://www.postgresql.org/docs/devel/nls-programmer.html#NLS-GUIDELINES



Commits

  1. Provide more-specific error details/hints for function lookup failures.