Re: Odd procedure resolution

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: Odd procedure resolution
Date: 2018-05-17 00:47:55
Message-ID: 20180517004755.GA2144@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-05-17 00:56:49 Re: Postgres 11 release notes
Previous Message Bruce Momjian 2018-05-17 00:29:18 Re: Postgres 11 release notes