Re: Fix hints on CREATE PROCEDURE errors

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Fix hints on CREATE PROCEDURE errors
Дата
Msg-id ebac3f1b-50c8-2bc4-a565-2cdd6a13d72c@2ndquadrant.com
обсуждение исходный текст
Ответ на Fix hints on CREATE PROCEDURE errors  (Jeremy Evans <code@jeremyevans.net>)
Ответы Re: Fix hints on CREATE PROCEDURE errors
Список pgsql-hackers
On 06/08/2018 20:32, Jeremy Evans wrote:
> The current code's hint is misleading for procedures:
> 
> CREATE OR REPLACE PROCEDURE a(in int)
> LANGUAGE SQL
> AS $$
> SELECT NULL;
> $$;
> # CREATE PROCEDURE
> 
> CREATE OR REPLACE PROCEDURE a(inout int)
> LANGUAGE SQL
> AS $$
> SELECT NULL;
> $$;
> # ERROR:  cannot change return type of existing function
> # HINT:  Use DROP FUNCTION a(integer) first.

Yes, the hint should be changed.  But I also think the error message
should be changed to be more appropriate to the procedure situation
(where is the return type?).  Attached patch does both.  Unlike your
patch, I kept the "DROP FUNCTION" message for the function case.  It
might be too confusing otherwise.  Thoughts?

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: REINDEX and shared catalogs
Следующее
От: Simon Muller
Дата:
Сообщение: Re: Allow COPY's 'text' format to output a header