diff --git i/src/bin/psql/tab-complete.c w/src/bin/psql/tab-complete.c index 3854f7f..416aa2f 100644 --- i/src/bin/psql/tab-complete.c +++ w/src/bin/psql/tab-complete.c @@ -2555,7 +2555,9 @@ psql_completion(char *text, int start, int end) COMPLETE_WITH_CONST("IS"); /* SELECT */ - /* naah . . . */ + /* complete with columns and functions */ + else if (pg_strcasecmp(prev_wd, "SELECT") == 0) + COMPLETE_WITH_QUERY("SELECT name FROM (SELECT attname FROM pg_attribute UNION SELECT proname || '(' FROM pg_proc) t (name) WHERE substring(name,1,%d)='%s'"); /* SET, RESET, SHOW */ /* Complete with a variable name */