Hi,

Please find attached a patch to help tab completion show only currently set
vars
during ALTER USER RESET.

Currently tab completion provides a list of all vars which is only
partially helpful.
This patch allows tab completion to see which vars are currently set for
the role
and only show those options during tab completion.


For example:
postgres=# \drds
                     List of settings
   Role   | Database |              Settings
----------+----------+-------------------------------------
 postgres |          | max_parallel_workers_per_gather=100+
          |          | max_parallel_workers=100
(1 row)

postgres=# alter user postgres reset
ALL                              max_parallel_workers
max_parallel_workers_per_gather

postgres=# alter user postgres reset max_parallel_workers;
ALTER ROLE

postgres=# \drds
                     List of settings
   Role   | Database |              Settings
----------+----------+-------------------------------------
 postgres |          | max_parallel_workers_per_gather=100
(1 row)

postgres=# alter user postgres reset
ALL                              max_parallel_workers_per_gather

postgres=# alter user postgres reset all;
ALTER ROLE

postgres=# \drds
Did not find any settings.

Applies on master (b6612aedc53a6) / make check successful.
-
Robins Tharakan
Amazon Web Services

Attachment: v1-0001-Add-tab-completion-for-ALTER-USER-RESET.patch
Description: Binary data

Reply via email to