[PATCH] psql: Complete GRANTED BY in GRANT and REVOKE
[PATCH] psql: Complete GRANTED BY in GRANT and REVOKE
Hi hackers,
While trying REVOKE ... GRANTED BY in PostgreSQL 19, I noticed that
psql doesn't complete the clause or the grantor's name.
I tried the corresponding GRANT and found that pressing Tab after
a trailing space on this line inserts TO, making the statement invalid.
GRANT SELECT ON t TO r WITH GRANT OPTION
Before the patch, the generic GRANT rule treats the trailing GRANT
OPTION as GRANT followed by a role name. The patch matches WITH
GRANT OPTION first, so Tab inserts GRANTED BY. It also completes
the clause and grantor name in both commands.
Thanks,
While trying REVOKE ... GRANTED BY in PostgreSQL 19, I noticed that
psql doesn't complete the clause or the grantor's name.
I tried the corresponding GRANT and found that pressing Tab after
a trailing space on this line inserts TO, making the statement invalid.
GRANT SELECT ON t TO r WITH GRANT OPTION
Before the patch, the generic GRANT rule treats the trailing GRANT
OPTION as GRANT followed by a role name. The patch matches WITH
GRANT OPTION first, so Tab inserts GRANTED BY. It also completes
the clause and grantor name in both commands.
Thanks,