Skip to content

Conversation

@sgaunet
Copy link
Owner

@sgaunet sgaunet commented Dec 7, 2025

Replace string manipulation (Trim/Split) with pq.StringArray to properly
handle PostgreSQL arrays containing column names with special characters.

Previous implementation incorrectly split on commas inside quoted identifiers,
breaking indexes with columns like "col,with,commas" or "Column Name".

Changes:

  • Use pq.StringArray for scanning PostgreSQL text[] arrays
  • Remove manual string parsing that failed on edge cases
  • Add comprehensive test for special characters (spaces, commas, braces)

Fixes #26

…haracters

Replace string manipulation (Trim/Split) with pq.StringArray to properly
handle PostgreSQL arrays containing column names with special characters.

Previous implementation incorrectly split on commas inside quoted identifiers,
breaking indexes with columns like "col,with,commas" or "Column Name".

Changes:
- Use pq.StringArray for scanning PostgreSQL text[] arrays
- Remove manual string parsing that failed on edge cases
- Add comprehensive test for special characters (spaces, commas, braces)

Fixes #26
@sgaunet sgaunet self-assigned this Dec 7, 2025
@sgaunet sgaunet linked an issue Dec 7, 2025 that may be closed by this pull request
6 tasks
@sgaunet sgaunet added the bug Something isn't working label Dec 7, 2025
@sgaunet sgaunet merged commit 4989efd into main Dec 7, 2025
5 checks passed
@sgaunet sgaunet deleted the 26-fix-postgresql-array-parsing-for-index-columns-with-special-characters branch December 7, 2025 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix PostgreSQL array parsing for index columns with special characters

2 participants