Allow psql \d tab completion to complete all relation kinds

This matches what \d actually accepts.
This commit is contained in:
Peter Eisentraut 2011-06-14 23:45:00 +03:00
parent da023acd1a
commit 707195c8f4
1 changed files with 3 additions and 3 deletions

View File

@ -369,11 +369,11 @@ static const SchemaQuery Query_for_list_of_updatables = {
NULL NULL
}; };
static const SchemaQuery Query_for_list_of_tisvf = { static const SchemaQuery Query_for_list_of_relations = {
/* catname */ /* catname */
"pg_catalog.pg_class c", "pg_catalog.pg_class c",
/* selcondition */ /* selcondition */
"c.relkind IN ('r', 'i', 'S', 'v', 'f')", NULL,
/* viscondition */ /* viscondition */
"pg_catalog.pg_table_is_visible(c.oid)", "pg_catalog.pg_table_is_visible(c.oid)",
/* namespace */ /* namespace */
@ -2826,7 +2826,7 @@ psql_completion(char *text, int start, int end)
/* must be at end of \d list */ /* must be at end of \d list */
else if (strncmp(prev_wd, "\\d", strlen("\\d")) == 0) else if (strncmp(prev_wd, "\\d", strlen("\\d")) == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tisvf, NULL); COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_relations, NULL);
else if (strcmp(prev_wd, "\\ef") == 0) else if (strcmp(prev_wd, "\\ef") == 0)
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_functions, NULL); COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_functions, NULL);