fresh regression - regproc result contains unwanted schema

Started by Pavel Stehuleover 8 years ago3 messageshackers
Jump to latest
#1Pavel Stehule
pavel.stehule@gmail.com

Hi

when I fixed old bug of plpgsql_check I found new regression of regproc
output.

set check_function_bodies TO off;

postgres=# create or replace function f1() returns int as $$ begin end $$
language plpgsql;
CREATE FUNCTION
postgres=# select 'f1()'::regprocedure::oid::regproc;
regproc
---------
f1
(1 row)

postgres=# create or replace function f1(int) returns int as $$ begin end
$$ language plpgsql;
CREATE FUNCTION
postgres=# select 'f1()'::regprocedure::oid::regproc;
regproc
-----------
public.f1
(1 row)

When function is overwritten, then regproc result contains schema, although
it is on search_path

This behave breaks regress tests (and it is not consistent)

Tested on master

Regards

Pavel

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Pavel Stehule (#1)
Re: fresh regression - regproc result contains unwanted schema

Pavel Stehule <pavel.stehule@gmail.com> writes:

When function is overwritten, then regproc result contains schema, although
it is on search_path

There's no "fresh regression" here, it's done that more or less since
we invented schemas. See regprocout:

* Would this proc be found (uniquely!) by regprocin? If not,
* qualify it.

git blame dates that comment to commit 52200bef of 2002-04-25.

Admittedly, qualifying the name might not be sufficient to disambiguate,
but regprocout doesn't have any other tool in its toolbox, so it uses
the hammer it's got. If you're overloading functions, you really need
to use regprocedure not regproc.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: Tom Lane (#2)
Re: fresh regression - regproc result contains unwanted schema

2017-10-14 17:26 GMT+02:00 Tom Lane <tgl@sss.pgh.pa.us>:

Pavel Stehule <pavel.stehule@gmail.com> writes:

When function is overwritten, then regproc result contains schema,

although

it is on search_path

There's no "fresh regression" here, it's done that more or less since
we invented schemas. See regprocout:

* Would this proc be found (uniquely!) by regprocin? If not,
* qualify it.

git blame dates that comment to commit 52200bef of 2002-04-25.

Admittedly, qualifying the name might not be sufficient to disambiguate,
but regprocout doesn't have any other tool in its toolbox, so it uses
the hammer it's got. If you're overloading functions, you really need
to use regprocedure not regproc.

It is false alarm. I am sorry. I shot by self. Thank you for explanation

Nice evening.

Pavel

Show quoted text

regards, tom lane