Fix: include views in PostgreSQL getTableComment() relkind filter#297
Merged
Fix: include views in PostgreSQL getTableComment() relkind filter#297
Conversation
The relkind filter excluded 'v' (ordinary views), so view comments were always null even when set via COMMENT ON VIEW. Closes #296 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes PostgreSQL view comments not appearing in search_objects output by aligning getTableComment()’s pg_class.relkind filter with objects returned from discovery, so obj_description() can resolve comments for ordinary views.
Changes:
- Include
relkind = 'v'(ordinary views) ingetTableComment()’spg_class.relkindfilter to returnCOMMENT ON VIEWvalues.
Comment on lines
382
to
386
| JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace | ||
| WHERE c.relname = $1 | ||
| AND n.nspname = $2 | ||
| AND c.relkind IN ('r','p','m','f') | ||
| AND c.relkind IN ('r','p','m','f','v') | ||
| `, |
There was a problem hiding this comment.
This change expands getTableComment() to include ordinary views (relkind='v'), but there’s no test asserting that a COMMENT ON VIEW is surfaced (either via getTableComment('view_name') or through search_objects detail output). Since integration tests already cover table comments, please add a corresponding view comment case to prevent regressions.
Creates a view with COMMENT ON VIEW in the test setup and asserts that getTableComment() returns the comment for views. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
amansingh63
added a commit
to amansingh63/dbhub-analytics
that referenced
this pull request
Apr 2, 2026
Upstream changes: - Make @aws-sdk/rds-signer and @azure/identity optional (bytebase#298) - Fix PostgreSQL view comments in getTableComment() (bytebase#297) - Version bump 0.21.0 → 0.21.1 Conflicts resolved: README.md, package.json, server.json, tsup.config.ts (kept dbhub-analytics branding, merged upstream code changes) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getTableComment()in the PostgreSQL connector filteredpg_class.relkind IN ('r','p','m','f'), excluding'v'(ordinary views)search_objectsalways had null comments despiteCOMMENT ON VIEWbeing set'v'to the relkind filter soobj_description()can return view commentsCloses #296
Test plan
COMMENT ON VIEW, callsearch_objectswithdetail_level: "full", confirm comment is returned🤖 Generated with Claude Code