Skip to content

Commit 5878911

Browse files
Tomasz-Kluczkowskiberkerpeksag
authored andcommitted
Simplify postgres database creating instructions. (#1287)
Simplified instructions for the contributors when they want to create a new database and must use postgres user account as the owner. Also added suggestion of what to do if the languages do not match.
1 parent 56b8707 commit 5878911

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

docs/source/install.rst

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,29 +67,17 @@ default. Run the following command to create a new database::
6767

6868
createdb: database creation failed: ERROR: permission denied to create database
6969

70-
Follow the steps below to create the database:
70+
Use the following command to create a database with *postgres* user as the
71+
owner::
7172

72-
Change to *postgres* user to perform database administrative tasks::
73+
$ sudo -u postgres createdb pythondotorg -E utf-8 -l en_US.UTF-8
7374

74-
$ sudo su - postgres
75+
If you get an error like this::
7576

76-
You should now be in a shell session for the *postgres* user. Log into a ``psql``
77-
session by typing::
77+
createdb: database creation failed: ERROR: new collation (en_US.UTF-8) is incompatible with the collation of the template database (en_GB.UTF-8)
7878

79-
$ psql
80-
81-
Finally create a database::
82-
83-
postgres=# createdb pythondotorg -E utf-8 -l en_US.UTF-8
84-
85-
Exit the SQL prompt to get back to the *postgres* user's shell session::
86-
87-
postgres=# \q
88-
89-
Exit out of the *postgres* user's shell session to get back to your regular
90-
user's shell session::
91-
92-
$ exit
79+
Then you will have to change the value of the ``-l`` option to what your
80+
database was set up with initially.
9381

9482
To change database configuration, you can add the following setting to
9583
``pydotorg/settings/local.py`` (or you can use the ``DATABASE_URL`` environment

0 commit comments

Comments
 (0)