Fix index/constraint column not shown when its name requires quoting (#6481)#10039
Fix index/constraint column not shown when its name requires quoting (#6481)#10039dpage wants to merge 1 commit into
Conversation
|
Warning Review limit reached
More reviews will be available in 7 minutes and 26 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR fixes issue ChangesQuoted Identifier Fix for Index and Constraint Columns
🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b1b1a54 to
ea60e15
Compare
…g#6481 The is_exp flag compared pg_get_indexdef() (which returns the SQL-quoted identifier) directly against a.attname (the raw name). For any column name needing quoting these differ, so a plain column was wrongly treated as an expression and not rendered, and validation reported it empty. Compare against pg_catalog.quote_ident(a.attname) instead, which matches pg_get_indexdef()'s output for both normal and quoted names; real expressions (attname NULL) still evaluate as expressions. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ea60e15 to
464cc15
Compare
Summary
Fixes #6481.
When an index (or exclusion constraint) column name requires quoting — e.g. it contains a double quote or other special characters — the column was not shown in the Properties panel, and editing reported it as empty.
Root cause: the
is_exp(expression) flag is computed aspg_get_indexdef(...) = a.attname.pg_get_indexdef()returns the SQL-quoted identifier (e.g."col""x") whilea.attnameis the raw name (col"x). For any name needing quoting these never match, so a plain column was misclassified as an expression and dropped.Fix: compare against
pg_catalog.quote_ident(a.attname), which yields the same quoted form aspg_get_indexdef()for both normal and special names. Real expression indexes (whereattnameis NULL) still evaluate as expressions.Changes
indexes/sql/11_plus/column_details.sql,indexes/sql/default/column_details.sql,exclusion_constraint/sql/default/get_constraint_cols.sql🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
Documentation
Bug Fixes