-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: create pg_trm extension for the GIN index creation #36722
Conversation
WalkthroughThe Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
- deploy/docker/fs/opt/appsmith/pg-utils.sh (1 hunks)
🧰 Additional context used
🔇 Additional comments (2)
deploy/docker/fs/opt/appsmith/pg-utils.sh (2)
Line range hint
1-159
: Class, let's summarize our review of the pg-utils.sh script.Overall, the addition of the
pg_trgm
extension is a positive change that aligns with the PR objective of creating a GIN index. You've done a good job integrating this new functionality into the existing script structure.However, there are a few areas where we can improve:
- Adding error handling for both local and remote setups.
- Using
IF NOT EXISTS
to prevent potential errors.- Ensuring the correct user is used for remote setups.
These changes will make the script more robust and less prone to errors. Remember, in database management, it's crucial to handle potential issues gracefully.
Keep up the good work, and don't hesitate to ask if you have any questions about the suggested improvements!
131-133
: 🛠️ Refactor suggestionClass, let's examine the creation of the pg_trgm extension for local PostgreSQL setups.
Good job on adding the
pg_trgm
extension! This will indeed help with text search operations. However, let's make a small improvement to avoid potential errors:Consider modifying the command to use
CREATE EXTENSION IF NOT EXISTS pg_trgm;
. This way, we won't encounter an error if the extension already exists. Here's how you can update it:echo "Creating pg_trgm extension..." -psql -h "$PG_DB_HOST" -p "$PG_DB_PORT" -U postgres -d "$PG_DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;" +psql -h "$PG_DB_HOST" -p "$PG_DB_PORT" -U postgres -d "$PG_DB_NAME" -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"Also, it would be beneficial to add error handling. Can you think of a way to check if the command was successful?
Likely invalid or redundant comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment.
Description
Due to the size limit on the BTree index we are creating GIN index for a permission group. To support this we need to create a pg_trm extension.
Automation
/ok-to-test tags="@tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11212861701
Commit: d62be8f
Cypress dashboard.
Tags:
@tag.Sanity
Spec:
Mon, 07 Oct 2024 10:46:39 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit
New Features
pg_trgm
extension for PostgreSQL, improving text search capabilities.Bug Fixes