Re: Odd procedure resolution - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Odd procedure resolution
Date
Msg-id ea1681c5-57e7-bd8b-8932-3e73acaf37bf@2ndquadrant.com
Whole thread Raw
In response to Re: Odd procedure resolution  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Odd procedure resolution  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Odd procedure resolution  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On 5/16/18 15:29, Tom Lane wrote:
> My opinion remains unchanged.  If you're unhappy about the system
> confusing procedure foo(int) and function foo(real), maybe the answer
> is to not overload the name "foo" with such enthusiasm.  But putting
> kluges into (some of) the lookup rules is just going to lead to its
> own problems and surprising results.
> 
> In particular, I dislike the idea that this patch would make routine
> names appear unique in some cases when they do not in others.
> Overloading is complicated/confusing enough without that.

I think I have made a mistake here.  I was reading in between the lines
of a competitor's documentation that they have functions and procedures
in different name spaces, which made me re-read the SQL standard, which
appears to support that approach.

So I'm proposing here a patch to fix that.  It is similar to the patch
proposed earlier in the thread, but more extensive.

One open problem in my patch is that regproc/regprocedure don't have a
way to distinguish functions from procedures.  Maybe a two-argument
version of to_regprocedure?  This will also affect psql's \ef function
and the like.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Incorrect comment in get_partition_dispatch_recurse
Next
From: Andrew Gierth
Date:
Subject: Re: [GSoC] Question about returning bytea array