INSTALL.pgsql.txt 1.82 KB
Newer Older
1 2
// $Id$

3
CREATE THE PostgreSQL DATABASE
4 5
------------------------------

6 7
Note that the database must be created with UTF-8 (Unicode) encoding.

8
1. CREATE DATABASE USER
9

10
   This step is only necessary if you don't already have a user set up (e.g.
11 12 13
   by your host) or you want to create new user for use with Drupal only. The
   following command creates a new user named "username" and asks for a
   password for that user:
14

15
     createuser --pwprompt --encrypted --no-createrole --no-createdb username
16

17
   If there are no errors then the command was successful
18 19

2. CREATE THE DRUPAL DATABASE
20

21
   This step is only necessary if you don't already have a database set up (e.g.
22 23 24
   by your host) or you want to create new database for use with Drupal only.
   The following command creates a new database named "databasename", which is
   owned by previously created "username":
25

26
     createdb --encoding=UTF8 --owner=username databasename
27

28
   If there are no errors then the command was successful
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

3. CREATE A SCHEMA OR SCHEMAS (Optional advanced)

  Drupal will run across different schemas within your database if you so wish.
  By default, Drupal runs inside the 'public' schema but you can use $db_prefix
  inside settings.php to define a schema for Drupal to inside of or specify tables
  that are shared inside of a separate schema. Drupal will not create schemas for
  you, infact the user that Drupal runs as should not be allowed to. You'll need
  execute the SQL below as a superuser (such as a postgres user) and replace
  'drupaluser' with the username that Drupal uses to connect to PostgreSQL with
  and replace schema_name with a schema name you wish to use such as 'shared':

    CREATE SCHEMA schema_name AUTHORIZATION drupaluser;

  Do this for as many schemas as you need. See default.settings.php for how to
  set which tables use which schemas.