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

Поиск
Список
Период
Сортировка
От Chao Li
Тема Re: Identifying function-lookup failures due to argument name mismatches
Дата
Msg-id EB981B36-AE8C-471F-A395-83D6A5249D37@gmail.com
обсуждение исходный текст
Ответ на Identifying function-lookup failures due to argument name mismatches  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Identifying function-lookup failures due to argument name mismatches
Список pgsql-hackers
Hi Tom,

On Aug 8, 2025, at 09:29, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Anyway, I'm not seriously proposing that this should be committed
as-is.  I'm throwing it out there in case anyone else has a good
idea or feels motivated to push on the problem some more.

Looks like you are looking for someone to work out a final patch. If that is true, I will be happy to work on this problem.

I couldn't quite let go of this, and after some thought I hit on the
idea of making FuncnameGetCandidates pass back a bitmask of flags
showing how far the match succeeded.  This seems to work pretty
nicely, allowing quite-detailed reports with only minimal added
overhead or code restructuring.  There's probably room for further
improvement, but it has less of a whiff of "quick single-purpose
hack".  See draft commit message for more details.

I traced this problem today, and I agree that making FuncnameGetCandidates to pass out some information should be right direction to go.

When there are multiple matches, I think we can find the best match by considering argument names/types, default values. If there are still multiple best matches, I think we can prompt all matches to client.

--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/




В списке pgsql-hackers по дате отправления: