RE: Fix some newly modified tab-complete changes - Mailing list pgsql-hackers

From shiy.fnst@fujitsu.com
Subject RE: Fix some newly modified tab-complete changes
Date
Msg-id OSZPR01MB63107AD7499FE2139B245375FD209@OSZPR01MB6310.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Fix some newly modified tab-complete changes  (Peter Smith <smithpb2250@gmail.com>)
Responses RE: Fix some newly modified tab-complete changes  ("shiy.fnst@fujitsu.com" <shiy.fnst@fujitsu.com>)
List pgsql-hackers
On Tue, Oct 4, 2022 4:17 PM Peter Smith <smithpb2250@gmail.com> wrote:
> 
> On Thu, Sep 29, 2022 at 12:50 PM shiy.fnst@fujitsu.com
> <shiy.fnst@fujitsu.com> wrote:
> >
> > On Wed, Sep 28, 2022 1:49 PM Kyotaro Horiguchi
> <horikyota.ntt@gmail.com> wrote:
> > >
> > > At Wed, 28 Sep 2022 14:14:01 +1000, Peter Smith
> > > <smithpb2250@gmail.com> wrote in
> ...
> > > >
> > > > 2. tab complete for GRANT
> > > >
> > > > test_pub=# grant <tab>
> > > > ALL                        EXECUTE
> > > > pg_execute_server_program  pg_read_server_files       postgres
> > > >           TRIGGER
> > > > ALTER SYSTEM               GRANT                      pg_monitor
> > > >           pg_signal_backend          REFERENCES
> > > > TRUNCATE
> > > > CONNECT                    INSERT                     pg_read_all_data
> > > >           pg_stat_scan_tables        SELECT                     UPDATE
> > > > CREATE                     pg_checkpoint
> > > > pg_read_all_settings       pg_write_all_data          SET
> > > >           USAGE
> > > > DELETE                     pg_database_owner
> > > > pg_read_all_stats          pg_write_server_files      TEMPORARY
> > > >
> > > > 2a.
> > > > grant "GRANT" ??
> > >
> > > Yeah, for the mement I thought that might a kind of admin option but
> > > there's no such a privilege. REVOKE gets the same suggestion.
> > >
> >
> > Maybe that's for "REVOKE GRANT OPTION FOR". But it is used by both
> GRANT and
> > REVOKE. I think it's a separate problem, I have tried to fix it in the attached
> > 0002 patch.
> >
> 
> I checked your v2-0002 patch and AFAICT it does fix properly the
> previously reported GRANT/REVOKE problem.
> 

Thanks for reviewing and testing it.

> ~
> 
> But, while testing I noticed another different quirk
> 
> It seems that neither the GRANT nor the REVOKE auto-complete
> recognises the optional PRIVILEGE keyword
> 
> e.g. GRANT ALL <tab> --> ON  (but not PRIVILEGE)
> e.g. GRANT ALL PRIV<tab> --> ???
> 
> e.g. REVOKE ALL <tab> --> ON (but not PRIVILEGE)..
> e.g. REVOKE ALL PRIV<tab> --> ???
> 

I tried to add tab-completion for it. Pleases see attached updated patch.

Regards,
Shi yu

Attachment

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Switching XLog source from archive to streaming when primary available
Next
From: Peter Eisentraut
Date:
Subject: Re: list of acknowledgments for PG15