diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-05-14 17:05:20 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2014-05-14 17:05:20 +0100 |
commit | 151060e763b04df132f081e54d103ba2636f89e8 (patch) | |
tree | e5c634660d9824b89c242f4de377e95257705dc3 /installing | |
parent | 8a31a6192302c1c23286f50c97c9c7c041c3a536 (diff) |
Run database commands from root shell
Easier to illustrate what's happening than remembering that you've
actually switched to the postgres linux user. Seems like Debian sudo has
different behaviour than ubuntu, so this seems more compatible for a
getting started guide
Diffstat (limited to 'installing')
-rw-r--r-- | installing/manual_install.md | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/installing/manual_install.md b/installing/manual_install.md index e6794881a..4938dc7c3 100644 --- a/installing/manual_install.md +++ b/installing/manual_install.md @@ -150,18 +150,20 @@ databases (e.g., SQLite), but the currently supported database is PostgreSQL If you don't have postgres installed: - apt-get install postgresql postgresql-client + $ sudo apt-get install postgresql postgresql-client Create a `foi` user from the command line, like this: - # su - postgres - $ createuser -s -P foi + # sudo -u postgres createuser -s -P foi + +_Note:_ Leaving the password blank will cause great confusion if you're new to +PostgreSQL. Then create the databases: - $ createdb -T template0 -E SQL_ASCII -O foi foi_production - $ createdb -T template0 -E SQL_ASCII -O foi foi_test - $ createdb -T template0 -E SQL_ASCII -O foi foi_development + # sudo -u postgres createdb -T template0 -E SQL_ASCII -O foi foi_production + # sudo -u postgres createdb -T template0 -E SQL_ASCII -O foi foi_test + # sudo -u postgres createdb -T template0 -E SQL_ASCII -O foi foi_development We create using the ``SQL_ASCII`` encoding, because in postgres this is means "no encoding"; and because we handle and store all kinds of data that may not @@ -178,8 +180,9 @@ and password of your postgres database. Make sure that the user specified in `database.yml` exists, and has full permissions on these databases. As they need the ability to turn off -constraints whilst running the tests they also need to be a superuser. If you -don't want your database user to be a superuser, you can add this line +constraints whilst running the tests they also need to be a superuser + +If you don't want your database user to be a superuser, you can add this line to the test config in `database.yml` (as seen in `database.yml-example`) disable_constraints: false |