diff --git a/docs/configuration/database.md b/docs/configuration/database.md index f5be85164..4179f846d 100644 --- a/docs/configuration/database.md +++ b/docs/configuration/database.md @@ -42,6 +42,13 @@ create user gotosocial with password 'some_really_good_password'; grant all privileges on database gotosocial to gotosocial; ``` +If you start using Postgres after 14, or you encounter `error executing command: error creating dbservice: db migration error: ERROR: permission denied for schema public`, you should grant `CREATE` permission to your db user: + +```psql +GRANT CREATE ON SCHEMA public TO gotosocial; +SELECT has_schema_privilege('gotosocial', 'public', 'CREATE'); -- should return t +``` + GoToSocial makes use of ULIDs (Universally Unique Lexicographically Sortable Identifiers) which will not work in non-English collate environments. For this reason it is important to create the database with `C.UTF-8` locale. To do that on systems which were already initialized with non-C locale, `template0` pristine database template must be used. If you want to use specific options when connecting to Postgres, you can use `db-postgres-connection-string` to define the connection string. If `db-postgres-connection-string` is defined, all other database related configuration fields will be ignored. For example, we can use `db-postgres-connection-string` to connect to `mySchema`, where the user name is `myUser` and password is `myPass` at `localhost` with the database name of `db`: