pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arthur Zakirov <a.zakirov@postgrespro.ru>
To: David Rowley <david.rowley@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Ash M <makmarath@hotmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #15572: Misleading message reported by "Drop function operation" on DB with functions having same name
Date: Thu, 14 Feb 2019 16:42:35 +0300
Message-ID: <2a286c8f-070e-f0e3-8463-0da163ad5c8a@postgrespro.ru> (raw)
In-Reply-To: <CAKJS1f9bAsZVodugqwAS6kSEtrOQKOEpdeBVJALR8iEZf9kHXg@mail.gmail.com>
References: <CAKJS1f9nQyOcCdjJ0HP=DCRanDLOCp7+L2QCnR2BAXM-8Zh5vw@mail.gmail.com>
	<201901071454.wxkoyoq4s5qp@alvherre.pgsql>
	<CAKJS1f9t5_Zfc7KVYmpsMjW3BqR_rXv2B3C7i7qukwdh11+yjA@mail.gmail.com>
	<19400.1546994166@sss.pgh.pa.us>
	<CAKJS1f-2-wVsN5zXaKWdp4xOUkkstnoPo0Lis6RQ=AEo3_pcig@mail.gmail.com>
	<CAKJS1f-ad5i_rtnRQiU4sE5L8M3rZT-JEz7eT9KSqPH0Z-0cPQ@mail.gmail.com>
	<CAKJS1f-6kdi2KyyCuHf4fM-Cuz4w99D1mMsOxhQEw2oaA5tW8g@mail.gmail.com>
	<13325.1549838359@sss.pgh.pa.us>
	<CAKJS1f9bAsZVodugqwAS6kSEtrOQKOEpdeBVJALR8iEZf9kHXg@mail.gmail.com>

Hello,

On 11.02.2019 05:36, David Rowley wrote:
> On Mon, 11 Feb 2019 at 11:39, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> I wonder whether you'd be better off replacing the two bools with an
>> enum, or something like that.
> 
> Okay. Here's a modified patch with the enum.

There is a LookupFuncWithArgs() call within CreateTransform() where 
`bool` is passed still:

tosqlfuncid = LookupFuncWithArgs(OBJECT_FUNCTION, stmt->tosql, *false*);

> I had a look and I can't see any other callers that pass nargs as -1
> and can pass noError as true. The only place I see is through
> get_object_address() in RemoveObjects(). There's another possible call
> in get_object_address_rv(), but there's only 1 call in the entire
> source for that function and it passes missing_ok as false.

If nargs as -1 and noError as true can be passed only within 
RemoveObjects() I wonder, could we just end up with a patch which raise 
an error at every ambiguity? That is I mean the following patch:

diff --git a/src/backend/parser/parse_func.c 
b/src/backend/parser/parse_func.c
index 5222231b51..cce8f49f52 100644
--- a/src/backend/parser/parse_func.c
+++ b/src/backend/parser/parse_func.c
@@ -2053,7 +2053,6 @@ LookupFuncName(List *funcname, int nargs, const 
Oid *argtypes, bool noError)
         {
             if (clist->next)
             {
-               if (!noError)
                     ereport(ERROR,
                             (errcode(ERRCODE_AMBIGUOUS_FUNCTION),
                              errmsg("function name \"%s\" is not unique",

But I may overlook something of course.

-- 
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company




view thread (38+ messages)  latest in thread

Message-ID: <2a286c8f-070e-f0e3-8463-0da163ad5c8a@postgrespro.ru>
Permalink:  ../2a286c8f-070e-f0e3-8463-0da163ad5c8a@postgrespro.ru/
Also on:    postgresql.org/message-id/2a286c8f-070e-f0e3-8463-0da163ad5c8a@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: a.zakirov@postgrespro.ru, david.rowley@2ndquadrant.com, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, makmarath@hotmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #15572: Misleading message reported by "Drop function operation" on DB with functions having same name
  In-Reply-To: <2a286c8f-070e-f0e3-8463-0da163ad5c8a@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox