postgres.git / summary / log / commit / refs
commit 62228ff1768d1170e41ca19d764687eb4e9ec3d6
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Thu Jul 27 18:13:15 2017 +0000
First released in: 10.0, 9.2.22, 9.3.18, 9.4.13, 9.5.8, 9.6.4
Fix psql tab completion for CREATE USER MAPPING.
After typing CREATE USER M..., it would not fill in MAPPING FOR,
even though that was clearly intended behavior.
Jeff Janes
Discussion: https://postgr.es/m/CAMkU=1wo2iQ6jWnN=egqOb5NxEPn0PpANEtKHr3uPooQ+nYPtw@mail.gmail.com
src/bin/psql/tab-complete.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 6a8bb0ee99e..b657ab7b8d6 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -818,7 +818,7 @@ static const pgsql_thing_t words_after_create[] = {
{"UNIQUE", NULL, NULL, THING_NO_DROP}, /* for CREATE UNIQUE INDEX ... */
{"UNLOGGED", NULL, NULL, THING_NO_DROP}, /* for CREATE UNLOGGED TABLE
* ... */
- {"USER", Query_for_list_of_roles},
+ {"USER", Query_for_list_of_roles " UNION SELECT 'MAPPING FOR'"},
{"USER MAPPING FOR", NULL, NULL},
{"VIEW", NULL, &Query_for_list_of_views},
{NULL} /* end of list */
[parent: 3095609dce85]