pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Improve error reporting for DROP FUNCTION/PROCEDURE/AGGREGATE/RO
Date: Fri, 22 Mar 2019 19:33:33 -0700
Message-ID: <20190323023333.tpovylk54modtlss@alap3.anarazel.de> (raw)
In-Reply-To: <E1h6zzT-0003ft-DD@gemulon.postgresql.org>
References: <E1h6zzT-0003ft-DD@gemulon.postgresql.org>

Hi,

On 2019-03-21 15:52:23 +0000, Tom Lane wrote:
> Improve error reporting for DROP FUNCTION/PROCEDURE/AGGREGATE/ROUTINE.
> 
> These commands allow the argument type list to be omitted if there is
> just one object that matches by name.  However, if that syntax was
> used with DROP IF EXISTS and there was more than one match, you got
> a "function ... does not exist, skipping" notice message rather than a
> truthful complaint about the ambiguity.  This was basically due to
> poor factorization and a rats-nest of logic, so refactor the relevant
> lookup code to make it cleaner.
> 
> Note that this amounts to narrowing the scope of which sorts of
> error conditions IF EXISTS will bypass.  Per discussion, we only
> intend it to skip no-such-object cases, not multiple-possible-matches
> cases.
> 
> Per bug #15572 from Ash Marath.  Although this definitely seems like
> a bug, it's not clear that people would thank us for changing the
> behavior in minor releases, so no back-patch.
> 
> David Rowley, reviewed by Julien Rouhaud and Pavel Stehule
> 
> Discussion: https://postgr.es/m/15572-ed1b9ed09503de8a@postgresql.org

I now get:

/home/andres/src/postgresql/src/backend/parser/parse_func.c: In function ‘LookupFuncWithArgs’:
/home/andres/src/postgresql/src/backend/parser/parse_func.c:2285:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
     switch (objtype)
     ^~~~~~
/home/andres/src/postgresql/src/backend/parser/parse_func.c:2336:4: note: here
    case FUNCLOOKUP_AMBIGUOUS:
    ^~~~

which seems like a somewhat righteous complaint? I'd just add a break to
silence it (which can't be reached, because all paths ought to error
out).

Greetings,

Andres Freund




view thread (4+ messages)  latest in thread

Message-ID: <20190323023333.tpovylk54modtlss@alap3.anarazel.de>
Permalink:  ../20190323023333.tpovylk54modtlss@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20190323023333.tpovylk54modtlss@alap3.anarazel.de

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de, tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com
  Subject: Re: pgsql: Improve error reporting for DROP FUNCTION/PROCEDURE/AGGREGATE/RO
  In-Reply-To: <20190323023333.tpovylk54modtlss@alap3.anarazel.de>
  References: <E1h6zzT-0003ft-DD@gemulon.postgresql.org> <20190323023333.tpovylk54modtlss@alap3.anarazel.de>

* 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