Improve tab completion of ALTER INDEX/TABLE with SET STATISTICS in psql
authorMichael Paquier <michael@paquier.xyz>
Tue, 25 Dec 2018 05:20:46 +0000 (14:20 +0900)
committerMichael Paquier <michael@paquier.xyz>
Tue, 25 Dec 2018 05:20:46 +0000 (14:20 +0900)
commitf89ae34ab8b4d9e9ce8af6bd889238b0ccff17cb
treef48157fbcc60fcb7c3c1e4bebe30a26d99dc6fc7
parentb981df4cc09aca978c5ce55e437a74913d09cccc
Improve tab completion of ALTER INDEX/TABLE with SET STATISTICS in psql

This fixes two issues with the completion of ALTER TABLE and ALTER INDEX
after SET STATISTICS is typed, trying to suggest schema objects while
the grammar only allows integers.

The tab completion of ALTER INDEX is made smarter by handling properly
more patterns.  COLUMN is an optional keyword, but as no column numbers
can be suggested yet as possible input simply adjust the completion so
as no incorrect queries are generated.

Author: Michael Paquier
Reviewed-by: Tatsuro Yamada
Discussion: https://postgr.es/m/20181219092255.GC680@paquier.xyz
src/bin/psql/tab-complete.c