Skip to content

Feature request: Show relation title in describe relation (\d) meta commands #158

@devadathanmb

Description

@devadathanmb

Issue: \d does not show relation titles in pgcli output

When using the \d meta-command in pgcli, the output does not include the relation title (for example Table "public.users" or Index "public.users_pkey").

This occurs for all usages of \d, not just wildcard patterns. As a result, the output lacks context about which relation is being described and becomes difficult to read when multiple tables or indexes are involved.

In contrast, psql prints a clear title for each relation (relation type and fully qualified name) before its description, which makes the output much easier to understand.

pgcli output:

pgcli output

psql output:

psql output

Pgspecial Issue

This behavior appears to originate in pgspecial. The describe_one_table_details() method always returns None for the title field, leaving the client with no relation name to render.

Relevant code:

# /* reloptions, if verbose */
if verbose and tableinfo.reloptions:
status.append(f"Options: {tableinfo.reloptions}\n")
return (None, cells, headers, "".join(status))

Related discussion

A related issue has been raised on the pgcli side: dbcli/pgcli#1521

If this is something the maintainers are open to supporting, I’d be happy to contribute the change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions