Skip to content

Conversation

@scottnursten-22
Copy link
Contributor

  • Move pg_trgm extension creation to initialization phase to ensure availability
  • Add error handling for similarity search queries that depend on pg_trgm
  • Implement fallback to basic ILIKE matching when pg_trgm is unavailable
  • Add proper logging for debugging search-related issues

Fixes issues where PostgreSQL search suggestions fail due to missing or improperly initialized pg_trgm extension, particularly in containerized environments where extension creation timing matters.

@NGPixel - as requested.

- Move pg_trgm extension creation to initialization phase to ensure availability
- Add error handling for similarity search queries that depend on pg_trgm
- Implement fallback to basic ILIKE matching when pg_trgm is unavailable
- Add proper logging for debugging search-related issues

Fixes issues where PostgreSQL search suggestions fail due to missing or
improperly initialized pg_trgm extension, particularly in containerized
environments where extension creation timing matters.
@auto-assign auto-assign bot requested a review from NGPixel November 13, 2025 12:41
Refactor error handling for search suggestions to simplify code.
@NGPixel NGPixel merged commit 407aacf into requarks:main Nov 13, 2025
@NGPixel
Copy link
Member

NGPixel commented Nov 13, 2025

Thanks.

I removed the ILIKE fallback section as I don't think it will yield relevant enough suggestions, especially since it looks in middle of words as well. pg_trgm is a base extension that should always be included unless you build postgres yourself, so I'd rather have admins focus on adding the missing extension that having a fallback that produces subpar results.

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