2 CREATE THE PostgreSQL DATABASE
3 ------------------------------
5 Note that the database must be created with UTF-8 (Unicode) encoding.
7 1. CREATE DATABASE USER
9 This step is only necessary if you don't already have a user set up (e.g., by
10 your host), or want to create a new user for use with Drupal only. The
11 following command creates a new user named 'username' and asks for a password
14 createuser --pwprompt --encrypted --no-createrole --no-createdb username
16 If there are no errors, then the command was successful.
18 2. CREATE DRUPAL DATABASE
20 This step is only necessary if you don't already have a database set up
21 (e.g., by your host) or want to create a new database for use with Drupal
22 only. The following command creates a new database named 'databasename',
23 which is owned by the previously created 'username':
25 createdb --encoding=UTF8 --owner=username databasename
27 If there are no errors, then the command was successful.
29 3. CREATE SCHEMA OR SCHEMAS (Optional advanced step)
31 Drupal will run across different schemas within your database if you so wish.
32 By default, Drupal runs inside the 'public' schema but you can use $db_prefix
33 inside settings.php to define a schema for Drupal to run inside of, or
34 specify tables that are shared inside of a separate schema. Drupal will not
35 create schemas for you. In fact, the user that Drupal runs as should not be
36 allowed to do this. You'll need to execute the SQL below as a superuser,
37 replace 'username' with the username that Drupal uses to connect to
38 PostgreSQL, and replace 'schema_name' with a schema name you wish to use,
41 CREATE SCHEMA schema_name AUTHORIZATION username;
43 Do this for as many schemas as you need. See default.settings.php for
44 instructions on how to set which tables use which schemas.