Re: Miscellaneous tab completion issue fixes

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Dagfinn Ilmari Mannsåker <ilmari(at)ilmari(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Miscellaneous tab completion issue fixes
Date: 2022-10-04 09:30:10
Message-ID: CALDaNm0xMxtQuGc0fgBsoVJTGfz-iHS37d_VubYMq24oxwgJtA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 4 Oct 2022 at 09:13, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Mon, Oct 03, 2022 at 06:29:32PM +0100, Dagfinn Ilmari Mannsåker wrote:
> > vignesh C <vignesh21(at)gmail(dot)com> writes:
> >> + else if (TailMatchesCS("\\dRp*"))
> >> + COMPLETE_WITH_QUERY(Query_for_list_of_publications[0].query);
> >> + else if (TailMatchesCS("\\dRs*"))
> >> + COMPLETE_WITH_QUERY(Query_for_list_of_subscriptions[0].query);
> >
> > These are version-specific queries, so should be passed in their
> > entirety to COMPLETE_WITH_VERSIONED_QUERY() so that psql can pick the
> > right version, and avoid sending the query at all if the server is too
> > old.
>
> +1.
>

Modified

>> +/* add these to Query_for_list_of_roles in OWNER TO contexts */
> >> +#define Keywords_for_list_of_owner_to_roles \
> >> +"CURRENT_ROLE", "CURRENT_USER", "SESSION_USER"
> >
> > I think this would read better without the TO, both in the comment and
> > the constant name, similar to the below only having GRANT without TO:
>
> Keywords_for_list_of_grant_roles is used in six code paths, so it
> seems to me that there is little gain in having a separate #define
> here. Let's just specify the list of allowed roles (RoleSpec) where
> OWNER TO is parsed.

I have removed the macro and specified the allowed roles.

Thanks for the comments, the attached v2 patch has the changes for the same.

Regards,
Vignesh

Attachment Content-Type Size
v2-0002-Include-CURRENT_ROLE-CURRENT_USER-and-SESSION_USE.patch text/x-patch 1.0 KB
v2-0001-Display-publications-and-subscriptions-for-tab-co.patch text/x-patch 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2022-10-04 09:33:15 Re: future of serial and identity columns
Previous Message Bharath Rupireddy 2022-10-04 09:28:57 Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures