Обсуждение: Wrong drop procedure example

Поиск
Список
Период
Сортировка

Wrong drop procedure example

От
PG Doc comments form
Дата:
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/sql-dropprocedure.html
Description:

Hi, 

I noticed that drop procedure with parenthesis doesn't work (procedure name
not found), but without parenthesis it works. 

Not OK: DROP PROCEDURE do_db_maintenance(); 
OK: DROP PROCEDURE do_db_maintenance; 

Br,
Norbert

Re: Wrong drop procedure example

От
Tom Lane
Дата:
PG Doc comments form <noreply@postgresql.org> writes:
> I noticed that drop procedure with parenthesis doesn't work (procedure name
> not found), but without parenthesis it works.
> Not OK: DROP PROCEDURE do_db_maintenance();
> OK: DROP PROCEDURE do_db_maintenance;

Works for me:

regression=# create procedure do_db_maintenance() as 'begin end' language plpgsql;
CREATE PROCEDURE
regression=# DROP PROCEDURE do_db_maintenance();
DROP PROCEDURE

This depends, of course, on how you declared the procedure (with
or without any parameters).

If we wrote the example without parens, that would just move the
set of failure conditions around, so I'm unconvinced that it'd
be an improvement.

            regards, tom lane