INSTALL.pgsql.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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.