INSTALL.pgsql.txt

CREATE THE PostgreSQL DATABASE
------------------------------

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

1. CREATE DATABASE USER

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

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

   If there are no errors, then the command was successful.

2. CREATE DRUPAL DATABASE

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

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

   If there are no errors, then the command was successful.

3. CREATE SCHEMA OR SCHEMAS (Optional advanced step)

   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 run inside of, or
   specify tables that are shared inside of a separate schema. Drupal will not
   create schemas for you. In fact, the user that Drupal runs as should not be
   allowed to do this. You'll need to execute the SQL below as a superuser,
   replace 'username' with the username that Drupal uses to connect to
   PostgreSQL, and replace 'schema_name' with a schema name you wish to use,
   such as 'shared':

     CREATE SCHEMA schema_name AUTHORIZATION username;

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

File

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