Skip to content

Commit fde42e5

Browse files
ewwollesenclaude
andauthored
Add \c mattermost step to PostgreSQL preparation grants (#8920)
* Add \c mattermost step to PostgreSQL preparation grants 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> * Add comment explaining the \c mattermost step 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> * Switch code-block to postgresql to handle \c cleanly 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> * Use text lexer to avoid Pygments error token on \c 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> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 67012b5 commit fde42e5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

source/deployment-guide/server/preparations.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ PostgreSQL v14+ is required for Mattermost server installations. :doc:`MySQL dat
5959
6060
e. If using PostgreSQL v15.x or later, additional grants are required:
6161

62-
.. code-block:: sql
62+
.. code-block:: text
6363
6464
ALTER DATABASE mattermost OWNER TO mmuser;
65+
-- Connect to the mattermost database so the schema grants below apply to the right schema
66+
\c mattermost
6567
ALTER SCHEMA public OWNER TO mmuser;
6668
GRANT USAGE, CREATE ON SCHEMA public TO mmuser;
6769

0 commit comments

Comments
 (0)