Re: Drop all overloads of a function without knowing parameter types

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Evan Martin <postgresql(at)realityexists(dot)net>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Drop all overloads of a function without knowing parameter types
Date: 2014-02-04 19:05:54
Message-ID: 20140204190554.GO10723@eldon.alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sergey Konoplev escribió:

> >> I understand the POV of both Evan and you here. However, I think that
> >> there might be a good solution for this particular case - to allow
> >> dropping functions by name only if it has the only signature, but if
> >> there are 2 or more signatures then print an error specifying all the
> >> forms of the function, eg.:
> >>
> >> ERROR: Can not drop function 'foo' because it has more then one
> >> signature: foo(integer), foo(text).

> I was writing about some kind of a compromise.

I wonder if it'd work to have some way to specify wildcards for function
arguments. For instance, if you say
DROP FUNCTION foo('*');
all versions with a single argument are dropped;
DROP FUNCTION foo('*', '*');
drops all versions with two arguments. If you do
DROP FUNCTION foo('*+');
then all versions are dropped regardless of number of arguments.

Maybe some kind of keyword instead of the funny-looking operators would
work better --- not proposing that exact syntax, only the general idea.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2014-02-04 19:10:43 Re: Re: Drop all overloads of a function without knowing parameter types
Previous Message David Johnston 2014-02-04 18:56:28 Re: Drop all overloads of a function without knowing parameter types