Hi,

On Thu, 25 Jun 2026 at 12:03, Kirill Reshke <[email protected]> wrote:

> Hi!
> If a user creates a malformed operator in theirs database, like:
>
> ```
> create or replace function f (name, name) RETURNS boolean AS $$ begin
> RETURN $1::text = $2::text; end; $$ LANGUAGE plpgsql;
> CREATE OPERATOR public.!~ ( LEFTARG = name, RIGHTARG = name, FUNCTION = f);
> ```
>
> then psql's meta-commands queries like \du stop working.
>
> That's because the catalog misses operators for leftarg = name,
> rightarg = name and oprname = '!~'.
>
> I think this can be enhanced a little by schema-qualifying psql's
> internal query.
> While this issue is fully the user's fault, I think psql can still be
> a little more conservative in operator selection, and work anyways.
> PFA POC patch.
>

Thanks for the patch!

I reviewed it and the changes look good to me.\du, \dn, \dt work
with a shadowing operation present.

Would it be worth adding a test (maybe in the psql regression suite) that
the
describe queries still return the expected rows when such an operator
exists?

Regards,
Ayush

Reply via email to