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