]> granicus.if.org Git - postgresql/commitdiff
Allow psql \d tab completion to complete all relation kinds
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 14 Jun 2011 20:45:00 +0000 (23:45 +0300)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 14 Jun 2011 20:51:11 +0000 (23:51 +0300)
This matches what \d actually accepts.

src/bin/psql/tab-complete.c

index a43d6e31592f3fbab879a02614fe4bebfd69e823..32f418306cd2423deb5030b988f500b7ee173029 100644 (file)
@@ -369,11 +369,11 @@ static const SchemaQuery Query_for_list_of_updatables = {
        NULL
 };
 
-static const SchemaQuery Query_for_list_of_tisvf = {
+static const SchemaQuery Query_for_list_of_relations = {
        /* catname */
        "pg_catalog.pg_class c",
        /* selcondition */
-       "c.relkind IN ('r', 'i', 'S', 'v', 'f')",
+       NULL,
        /* viscondition */
        "pg_catalog.pg_table_is_visible(c.oid)",
        /* namespace */
@@ -2826,7 +2826,7 @@ psql_completion(char *text, int start, int end)
 
        /* must be at end of \d list */
        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)
                COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_functions, NULL);