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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, 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 16:48:38
Message-ID: 14464.1391532518@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sergey Konoplev <gray(dot)ru(at)gmail(dot)com> writes:
> On Tue, Feb 4, 2014 at 8:35 AM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>> Sergey Konoplev escribi:
>>> On Mon, Feb 3, 2014 at 10:09 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>>> People periodically ask for extensions flavored more or less like this,
>>>> but I'm suspicious of building any such thing into the core. There's too
>>>> little commonality in the exact conditions they want to search on.
>>>> Leaving it at the level of a scripting problem, as above, allows arbitrary
>>>> customization of the search condition.

>>> 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).

>> But that doesn't solve Evan's request. He would want both functions
>> gone, not an error.

> I was writing about some kind of a compromise.

My point was precisely that a compromise would satisfy nobody. There
would be a few cases for which it was Exactly The Right Thing, and many
more for which you'd still need to learn how to do the EXECUTE trick.

I wonder whether we shouldn't address this by adding a few examples
of that type of trick to the docs. Not sure where, though ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sergey Konoplev 2014-02-04 17:06:43 Re: Drop all overloads of a function without knowing parameter types
Previous Message Dmitriy Igrishin 2014-02-04 16:44:52 Re: Drop all overloads of a function without knowing parameter types