Re: [PATCH] psql: tab completion for ALTER ROLE ... IN DATABASE ...

surya poondla <suryapoondla4@gmail.com>

From: surya poondla <suryapoondla4@gmail.com>
To: Ian Lawrence Barwick <barwick@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-12-11T21:30:01Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. psql: Tab-complete ALTER ROLE ... IN DATABASE SET/RESET

Hi All,

Thanks to Ian and Vasuki for working on tab-completion support for ALTER
ROLE ... IN DATABASE.
This is a really good improvement.

Regarding Ian’s patch:
1. The patch applies cleanly and works as expected.
2. Tab-completion for IN DATABASE behaves consistently with existing ALTER
ROLE forms.

Suggestion: consider adding regression tests in "src/bin/psql/t/" to cover
these new cases.


Regarding Vasuki’s patch:
1. Really nice idea to extend completion for RESET by querying
pg_db_role_setting.
2. Use of PQescapeLiteral() (safe quoting) and consistent fallback to ALL
is really nice, and if the user falls back to 'ALL' maybe it is a good idea
to log it or let the user know of it.

Suggestion: consider adding regression tests in "src/bin/psql/t/" to cover
these new cases for SET/RESET.

Overall both patches look great.

Regards,
Surya