Shell: \d PATTERN describes instead of listing relations

Open Beginner friendly
#149 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
postgresql, typescript
Domain
cli, databases

Research direction

Start in components/shell/meta.ts at the case "\d" branch and inspect expandMeta, comparing it with the \dt and \dv handling. Re-run the supplied expandMeta examples, then verify that wildcard arguments produce query behavior, exact names still produce describe behavior, and the existing \dt behavior remains unchanged.

Written by the indexing model from the issue text.

Description

bug ready-for-agent

Symptom

Help text documents \d[+] [PATTERN] with * / ? wildcards for listing relations. Any non-empty argument takes the describe path ('::regclass'), so pattern forms fail with “relation does not exist” instead of listing.

Examples:

  • \d user* — should list matching relations; currently describe
  • \d * — same
  • \dt user* — correctly lists (control)

Exact names like \d users should still describe.

Red loop (already run)

import { expandMeta } from './components/shell/meta.ts';
expandMeta('\\d user*').kind; // got "describe", expect "query"
expandMeta('\\dt user*').kind; // "query" (ok)

Where

  • components/shell/meta.tscase "\\d": any argkind: "describe"; no pattern vs name branch
  • Help copy in the same file advertises PATTERN support

Notes

Diagnosed with /diagnosing-bugs. Fix should treat args containing * / ? (and possibly bare patterns) as list queries, matching \dt / \dv behaviour.

Dominant language
MDX
Stars
7
Forks
1
Avg merge
1d 2h
Merged PRs (30d)
36

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xataio/learn-postgres

All issues in xataio/learn-postgres

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.