Re: Adding error messages to a few slash commands

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Abhishek Chanda <abhishek(dot)becs(at)gmail(dot)com>
Cc: Robin Haberkorn <haberkorn(at)b1-systems(dot)de>, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Adding error messages to a few slash commands
Date: 2025-10-16 04:20:11
Message-ID: aPBye_cT_wDjb6-L@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 15, 2025 at 10:56:47PM -0500, Abhishek Chanda wrote:
> Thanks a lot for the review, Robin. And I am terribly sorry for the
> slow reply, it just took me a while to get to this. But I think I have
> addressed all your feedback, I have changed everything to set an error
> code of 1 if anything is not empty. Also added tests for the return
> code as requested, and cleaned up the change in describeRoles().
> Please let me know if I missed anything.
>
> Attached an updated and rebased version of the patch.

There is something that I am not following here. The consensus of the
thread seems to be that folks are OK to show the results as empty
tables instead of an error, backtracking on the "historical" reasons
documented in the code. That's OK by me. Why not.

However, your patch does the opposite. For example:
=# \dg "no.such.role"
Did not find any role named ""no.such.role"".

On HEAD, this returns:
=# \dg "no.such.role"
List of roles
Role name | Attributes
-----------+------------

So your patch is doing the opposite of the consensus I am reading.
Note that `make check` complains immediately with that. You also may
want to be careful that all the code paths you are patching are
covered in the regression tests.
--
Michael

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2025-10-16 04:24:51 Re: Checkpointer write combining
Previous Message Michael Paquier 2025-10-16 04:07:56 Re: [PROPOSAL] comments in repl_scanner