Skip to content

docs(dump): document --qualify-schema flag (#321)#494

Merged
tianzhou merged 4 commits into
mainfrom
docs/qualify-schema-dump
Jun 30, 2026
Merged

docs(dump): document --qualify-schema flag (#321)#494
tianzhou merged 4 commits into
mainfrom
docs/qualify-schema-dump

Conversation

@tianzhou

Copy link
Copy Markdown
Contributor

Documents the dump --qualify-schema flag shipped in #492 (issue #321).

Changes (docs-only, docs/cli/dump.mdx)

Notes

  • Examples follow the page's existing stylized form (inline REFERENCES, no IF NOT EXISTS) to parallel the smart-qualification example directly above.
  • Reviewed locally by @PG-Codex (wording-accuracy pass on the index-name coverage).

🤖 Generated with Claude Code

tianzhou and others added 2 commits June 29, 2026 21:23
Document the newly shipped `dump --qualify-schema` flag:
- Add a --qualify-schema ParamField under Output Options.
- Add a "Forced Qualification" subsection under Schema Qualification with
  motivation (reserved-word ambiguity #320, static analysis), an example
  showing fully qualified object identifiers, the coverage scope, and a
  note on the same-schema type-reference limitation (#493).
- Mention forced qualification in the Overview.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
pg-codex review: the coverage text overpromised by listing index among
names emitted as schema.object. CREATE INDEX names stay unqualified
(PostgreSQL derives the index schema from its table); only the ON-table
target and COMMENT ON INDEX are qualified.

- Soften "every object identifier is written as schema.object" to "object
  names and references ... wherever PostgreSQL syntax permits".
- Coverage sentence: drop index from the generic names list and call it
  out separately as "index targets and comments".
- Add a note after the index example clarifying CREATE INDEX names stay
  unqualified.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 30, 2026 04:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents the existing pgschema dump --qualify-schema flag (introduced in #492) in the dump CLI docs, explaining when and why to use forced schema qualification and clarifying current limitations.

Changes:

  • Adds --qualify-schema to the Output Options parameter list with default/behavior and links to details.
  • Expands Schema Qualification docs with a new Forced Qualification subsection, including examples, motivations, and a limitation note linking to #493.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@greptile-apps

greptile-apps Bot commented Jun 30, 2026

Copy link
Copy Markdown

Greptile Summary

This PR is a documentation-only change that adds a reference entry and a usage section for the --qualify-schema flag introduced in #492. The new content is accurate, well-structured, and consistent with the rest of the page.

Confidence Score: 4/5

Documentation-only change with no code modifications; safe to merge after addressing the minor wording nit.

The added content is accurate and well-organized. The only issues are a slightly imprecise phrase in the ParamField description ("wherever PostgreSQL syntax permits" doesn't match the real reason type references stay unqualified) and a missing trailing newline — both cosmetic. There is no risk of behavioral regression from a docs change.

docs/cli/dump.mdx — the ParamField description wording and missing trailing newline are worth fixing before merge.

Important Files Changed

Filename Overview
docs/cli/dump.mdx Adds documentation for --qualify-schema flag: new ParamField in Output Options, a Forced Qualification subsection with SQL example and usage bullets, and a Note about the type-reference limitation. One minor wording nuance in the ParamField description and a missing trailing newline.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[pgschema dump] --> B{--qualify-schema flag?}
    B -- No --> C[Smart Qualification]
    B -- Yes --> D[Forced Qualification]

    C --> C1[Objects in dumped schema: no qualifier]
    C --> C2[Objects in other schemas: fully qualified]

    D --> D1[Table / view / sequence / type names: schema.object]
    D --> D2[REFERENCES targets: schema.object]
    D --> D3[OWNED BY / COMMENT / ON targets: schema.object]
    D --> D4[Index target table: schema.object]
    D --> D5[Index name: unqualified - index lives in table's schema]
    D --> D6[Comment headers: show schema instead of '-']
    D --> D7[Type references in columns/params: NOT qualified - limitation tracked in #493]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[pgschema dump] --> B{--qualify-schema flag?}
    B -- No --> C[Smart Qualification]
    B -- Yes --> D[Forced Qualification]

    C --> C1[Objects in dumped schema: no qualifier]
    C --> C2[Objects in other schemas: fully qualified]

    D --> D1[Table / view / sequence / type names: schema.object]
    D --> D2[REFERENCES targets: schema.object]
    D --> D3[OWNED BY / COMMENT / ON targets: schema.object]
    D --> D4[Index target table: schema.object]
    D --> D5[Index name: unqualified - index lives in table's schema]
    D --> D6[Comment headers: show schema instead of '-']
    D --> D7[Type references in columns/params: NOT qualified - limitation tracked in #493]
Loading

Reviews (1): Last reviewed commit: "docs(dump): correct --qualify-schema cov..." | Re-trigger Greptile

Comment thread docs/cli/dump.mdx Outdated
Comment thread docs/cli/dump.mdx Outdated
- ParamField: drop "wherever PostgreSQL syntax permits" — it implied the
  type-reference limitation is a syntax restriction, but PostgreSQL does
  permit qualified type refs; they stay bare because the catalog/IR store
  in-schema type names without a schema. Reword to name the two actual
  exceptions (CREATE INDEX names, same-schema type refs) and point to the
  detail section. Removed the now-redundant trailing "see" line.
- Add trailing newline at EOF.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread docs/cli/dump.mdx
Comment thread docs/cli/dump.mdx Outdated
Comment thread docs/cli/dump.mdx
…494)

Three accuracy fixes:
- ParamField + detail bullet no longer claim schema qualification makes a
  reserved-word name parse as an identifier (that's quoting, which
  pgschema applies independently). Reframe the value as unambiguous
  resolution regardless of search_path, and note reserved words are
  handled by quoting (e.g. "user").
- Add a note that forced qualification does NOT rewrite free-form SQL
  text (view definitions, policy USING/WITH CHECK, function/procedure
  bodies) — so a reference like example.user inside a function body is
  unaffected by the flag.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tianzhou tianzhou merged commit c281905 into main Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants