Re: The keyword in the procedure's error message is "function", which should be "procedure"

Поиск
Список
Период
Сортировка
От qtds_126
Тема Re: The keyword in the procedure's error message is "function", which should be "procedure"
Дата
Msg-id 4886d08d.1411.18363f8c1cf.Coremail.qtds_126@126.com
обсуждение исходный текст
Ответ на Re: The keyword in the procedure's error message is "function", which should be "procedure"  (Junwang Zhao <zhjwpku@gmail.com>)
Список pgsql-bugs
font{ line-height: 1.6; } ul,ol{ padding-left: 20px; list-style-position: inside; }
Hi Zhao

Thank you for your reply, I understand.
The issue can be considered as a suggested feature improvement.
I think it would be better to use the keyword "procedure" in the error message if we can be sure that it is indeed a procedure error. This will not be misunderstood by the user.
---- Replied Message ----
From Junwang Zhao<zhjwpku@gmail.com>
Date 9/21/2022 23:05
To qtds_126<qtds_126@126.com>
Cc pgsql-bugs@lists.postgresql.org<pgsql-bugs@lists.postgresql.org>
Subject Re: The keyword in the procedure's error message is "function", which should be "procedure"
hi qtds_123,

After some discussion with the hacker lists, this should not be considered a bug.

quote from tom lane's comments:

More generally: there are probably dozens, if not hundreds, of
messages in the backend that say "function" but nowadays might
also be talking about a procedure.  I'm not sure there's value
in improving just one of them.

I am pretty sure that we made an explicit decision some time back
that it is okay to say "function" when the object could also be
an aggregate or window function.  So you could at least cut this
back to just handling "procedure" and "function".  Or you could
change it to "routine" as Julien suggests, but I think a lot of
people will not think that's an improvement.

see thread [1] for more information.



On Wed, Sep 21, 2022 at 7:13 PM qtds_126 <qtds_126@126.com> wrote:
Bug Report
When an existing procedure is created in the database, an error message is prompted for an existing procedure.
But the error message says "function" type.
PostgreSQL version
 11~15
Test SQL
create procedure proc_insert_t_pg_varchar(id int, v varchar)
language plpgsql
as $$
declare
iid int;
vv varchar(5);
begin
iid = id;
vv = v;
insert into t_pg_varchar values(iid, vv);
end;
$$;
Test result

Expected behavior
When an error occurs in procedure, the keyword is changed from "function" to "procedure".

Thanks.


--
Regards
Junwang Zhao
Вложения

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

Предыдущее
От: Masahiko Sawada
Дата:
Сообщение: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end
Следующее
От: Thomas Munro
Дата:
Сообщение: Re: BUG #17619: AllocSizeIsValid violation in parallel hash join