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

From Haruna Miwa
Subject Re: [PATCH] psql: avoid CREATE command completion after GRANT/REVOKE CREATE
Date
Msg-id OSOP286MB7853F5DD443864B8E09A930BF1942@OSOP286MB7853.JPNP286.PROD.OUTLOOK.COM
Whole thread
In response to Re: [PATCH] psql: avoid CREATE command completion after GRANT/REVOKE CREATE  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: [PATCH] psql: avoid CREATE command completion after GRANT/REVOKE CREATE
List pgsql-hackers
Fujii-san,

Thank you for your review.
I've attached the revised patch.

Regards,

Haruna Miwa


From: Fujii Masao <masao.fujii@gmail.com>
Sent: Wednesday, October 07, 2026 16:43
To: Sho Ito <i.sho.0628@gmail.com>
Cc: Haruna Miwa <miwa@sraoss.co.jp>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] psql: avoid CREATE command completion after GRANT/REVOKE CREATE

On Wed, Oct 7, 2026 at 12:24 PM Sho Ito <i.sho.0628@gmail.com> wrote:
>
> 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 for the patch! It looks good to me except for one minor comment.

The source comment in the middle of the conditions is a bit hard to read.
How about moving it above the conditions and explaining why these cases are
excluded? For example:

/* CREATE */
- /* complete with something you can create */
+ /*
+ * Complete with something you can create. If CREATE is a privilege
+ * name, leave it to the GRANT/REVOKE rules below.
+ */
  else if (TailMatches("CREATE") &&
-
- /*
- * exclude cases of GRANT/REVOKE CREATE and REVOKE GRANT OPTION FOR
- * CREATE
- */

Regards,

--
Fujii Masao
Attachment

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: Include schema-qualified names in publication error messages (generalised to all of LR).
Next
From: Michael Paquier
Date:
Subject: Re: Compression of bigger WAL records