Add \c mattermost step to PostgreSQL preparation grants#8920
Conversation
The ALTER SCHEMA public and GRANT USAGE, CREATE ON SCHEMA public commands operate on the current database's public schema, so users must connect to the mattermost database before running them. Without \c mattermost, these grants are applied to the wrong database's public schema. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughDocumentation update to PostgreSQL v15.x+ database preparation instructions adds an explicit connection command ( Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 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 |
There was a problem hiding this comment.
Pull request overview
Updates the Mattermost Server deployment preparation docs to ensure PostgreSQL schema grants are applied to the correct database when using PostgreSQL v15.x+.
Changes:
- Adds an explicit
\c mattermoststep before running schema-levelALTER SCHEMA/GRANTcommands in the PostgreSQL v15.x+ preparation flow.
|
Newest code from mattermost has been published to preview environment for Git SHA 1fdd8d1 |
Clarifies that the connection switch is what makes the subsequent ALTER SCHEMA and GRANT commands target the mattermost database's public schema. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Newest code from mattermost has been published to preview environment for Git SHA d209c34 |
The generic sql lexer flags \c as an unknown token (red error box in rendered output). The postgresql lexer recognizes psql meta-commands like \c as builtins, so the block renders cleanly while still highlighting the SQL statements. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Newest code from mattermost has been published to preview environment for Git SHA f4e6162 |
Both the sql and postgresql Pygments lexers flag backslash-prefixed psql meta-commands as error tokens (rendered as a red box). Switch to the text lexer so the block renders cleanly. Loses SQL syntax highlighting on four lines, but keeps the commands as a single copy-pasteable unit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Newest code from mattermost has been published to preview environment for Git SHA b75ae92 |
|
@hanzei I am 99% sure that connect step is needed prior to changing those permissions. I'm also pretty certain this is why we have so many |
Summary
In the PostgreSQL preparation steps for v15.x or later (database-preparation step 5e), the
ALTER SCHEMA publicandGRANT USAGE, CREATE ON SCHEMA publiccommands operate on the current database'spublicschema. Without first connecting to themattermostdatabase, those grants are applied to whatever database the admin happens to be connected to (typicallypostgres), leaving the actualmattermostdatabase without the required schema permissions.This PR adds a
\c mattermoststep betweenALTER DATABASEand the schema-level commands so the grants land on the right schema.Before:
After:
Test plan
deployment-guide/server/preparations.html#database-preparationshows the new\c mattermostline in the step 5e code block.psqlagainst a fresh PostgreSQL 15+ instance results inmmuserowning thepublicschema of themattermostdatabase.🤖 Generated with Claude Code