diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index a1ccc65..f9b461d 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -576,7 +576,9 @@ static const SchemaQuery Query_for_list_of_matviews = { " SELECT pg_catalog.quote_ident(rolname) "\ " FROM pg_catalog.pg_roles "\ " WHERE substring(pg_catalog.quote_ident(rolname),1,%d)='%s'"\ -" UNION ALL SELECT 'PUBLIC'" +" UNION ALL SELECT 'PUBLIC'"\ +" UNION ALL SELECT 'CURRENT_USER'"\ +" UNION ALL SELECT 'SESSION_USER'"\ /* the silly-looking length condition is just to eat up the current word */ #define Query_for_table_owning_index \ @@ -3040,6 +3042,11 @@ psql_completion(const char *text, int start, int end) pg_strcasecmp(prev_wd, "TABLE") == 0) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_foreign_tables, NULL); +/* FOREIGN SERVER */ + else if (pg_strcasecmp(prev2_wd, "FOREIGN") == 0 && + pg_strcasecmp(prev_wd, "SERVER") == 0) + COMPLETE_WITH_QUERY(Query_for_list_of_servers); + /* GRANT && REVOKE */ /* Complete GRANT/REVOKE with a list of roles and privileges */ else if (pg_strcasecmp(prev_wd, "GRANT") == 0 ||