Re: If there are more than two functions in different schemas, the functions have the same name and same arguments, \df[+] only display the function that schema first appeared in the search_path. - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: If there are more than two functions in different schemas, the functions have the same name and same arguments, \df[+] only display the function that schema first appeared in the search_path.
Date
Msg-id CAKFQuwYSAaQ1O_maDi2hBn-Vh8qe3AW8rE+-D-+fFAQ+86JhGw@mail.gmail.com
Whole thread Raw
In response to If there are more than two functions in different schemas, the functions have the same name and same arguments, \df[+] only display the function that schema first appeared in the search_path.  (金 <jinbinge@126.com>)
List pgsql-hackers
On Sunday, January 15, 2023, 金 <jinbinge@126.com> wrote:


postgres=# \df fun1

                                      List of functions

 Schema | Name | Result data type |                Argument data types                 | Type 

--------+------+------------------+----------------------------------------------------+------

 public | fun1 | record           | arg1 integer, OUT arg2 integer, INOUT arg3 integer | func

(1 row)

Working as documented.
 

postgres=# SELECT pg_function_is_visible(16386);
 pg_function_is_visible 
------------------------
 t
(1 row)


 
postgres=# SELECT pg_function_is_visible(16389);  --Should display t?
 pg_function_is_visible 
------------------------
 f
(1 row)

No, visible means is the one found by looking through the current search_path, and the one in s1 is not visible for the very reason that the one in public is visible.

You need to read the Patterns section of the psql documentation where the behavior to expect is described.

David J.

pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: Small miscellaneus fixes (Part II)
Next
From: Amit Kapila
Date:
Subject: Re: Perform streaming logical transactions by background workers and parallel apply