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.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: 金 <jinbinge(at)126(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
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: 2023-01-16 06:33:56
Message-ID: CAKFQuwYSAaQ1O_maDi2hBn-Vh8qe3AW8rE+-D-+fFAQ+86JhGw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sunday, January 15, 2023, 金 <jinbinge(at)126(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2023-01-16 06:40:50 Re: Perform streaming logical transactions by background workers and parallel apply
Previous Message John Naylor 2023-01-16 06:28:02 Re: Small miscellaneus fixes (Part II)