Re: [PATCH] psql: avoid CREATE command completion after GRANT/REVOKE CREATE - Mailing list pgsql-hackers

From Sho Ito
Subject Re: [PATCH] psql: avoid CREATE command completion after GRANT/REVOKE CREATE
Date
Msg-id CAG7L5+5bxf=eagZOUqjpMkOSsb11+u92O+TC49jQmACogVY3dA@mail.gmail.com
Whole thread
In response to Re: [PATCH] psql: avoid CREATE command completion after GRANT/REVOKE CREATE  (Haruna Miwa <miwa@sraoss.co.jp>)
Responses Re: [PATCH] psql: avoid CREATE command completion after GRANT/REVOKE CREATE
List pgsql-hackers
Hi Haruna,

Thank you for updating the patch. I tested v2 and confirmed that all three forms now complete to `ON` as expected.
Now it looks good to me.

Thanks,
Sho

On Tue, Oct 6, 2026 at 4:30 AM Haruna Miwa <miwa@sraoss.co.jp> wrote:
Hi, Sho

Thank you for testing the patch and for your feedback.

I've updated the patch to also handle the `REVOKE GRANT OPTION FOR CREATE` case,
so it now reaches the same privilege-completion rule and suggests `ON` as expected.

Attached is the updated patch.

Regards,
Haruna




From: Sho Ito <i.sho.0628@gmail.com>
Sent: Monday, October 5, 2026 7:03
To: Haruna Miwa <miwa@sraoss.co.jp>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] psql: avoid CREATE command completion after GRANT/REVOKE CREATE
 
Hi Haruna,

I tested the patch and confirmed that `GRANT CREATE` and `REVOKE CREATE` now complete to `ON` as expected, including lowercase input.

I also found that `REVOKE GRANT OPTION FOR CREATE` should reach the same privilege-completion rule, but the earlier `TailMatches("CREATE")` branch still intercepts it and offers CREATE object types instead of `ON`.

Perhaps it would be a good idea to cover this form in the same patch. What do you think?

Thanks,
Sho Ito

On Sun, Oct 4, 2026 at 5:57 PM Haruna Miwa <miwa@sraoss.co.jp> wrote:
Hi,

While testing psql tab completion, I noticed that the generic CREATE
completion rule is triggered after GRANT CREATE and REVOKE CREATE.

This results in irrelevant CREATE object type suggestions being offered
in those contexts.

I created a patch to exclude GRANT CREATE and REVOKE CREATE from the
generic CREATE completion rule.

Regards,

Haruna Miwa

--
Haruna Miwa


--
=======================================
Sho Ito (Sean)

=======================================


--
=======================================
Sho Ito (Sean)

=======================================

pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Fix "unexpected logical decoding status change" error; from concurrent logical decoding activation
Next
From: shveta malik
Date:
Subject: Re: Fix "unexpected logical decoding status change" error; from concurrent logical decoding activation