Re: Odd procedure resolution - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Odd procedure resolution
Date
Msg-id 20180517004755.GA2144@paquier.xyz
Whole thread Raw
In response to Re: Odd procedure resolution  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Wed, May 16, 2018 at 03:37:18PM -0400, Robert Haas wrote:
> On Wed, May 16, 2018 at 3:29 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > BTW, we seem to have some confusion here already:
> >
> > regression=# create function foo(int) returns int as 'select $1' language sql;
> > CREATE FUNCTION
> > regression=# create procedure foo(text) as 'select $1' language sql;
> > CREATE PROCEDURE
> > regression=# drop function foo;
> > ERROR:  function name "foo" is not unique
> > HINT:  Specify the argument list to select the function unambiguously.
> > regression=# drop routine foo;
> > ERROR:  function name "foo" is not unique
> > HINT:  Specify the argument list to select the function unambiguously.
> > regression=# drop procedure foo;
> > ERROR:  could not find a procedure named "foo"
> >
> > The first two errors are what I'd expect, but why is the third
> > different?
>
> Good question.

I actually find the first error messages ambiguous as well, so that
looks like a bug to me when a lookup is done for those function names.
Shouldn't DROP FUNCTION work only on functions and DROP PROCEDURE only
on procedures?  It is documented that DROP ROUTINE can work on
aggregates, functions and procedures, but the docs tell a different
story about DROP PROCEDURE and DROP FUNCTION.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Postgres 11 release notes
Next
From: Michael Paquier
Date:
Subject: Re: Postgres 11 release notes