Difference between revisions of "PostgreSQL"

Jump to: navigation, search
m (See also)
(copying recent changes from 21 wiki)
Line 1: Line 1:
 +
{{Installing Moodle}}
 
PostgreSQL is one of the two databases that is fully supported by Moodle. A database is a required component of any Moodle installation.
 
PostgreSQL is one of the two databases that is fully supported by Moodle. A database is a required component of any Moodle installation.
  
PostgreSQL describes itself as "an object-relational database management system (ORDBMS) based on POSTGRES, Version 4.2, developed at the University of California at Berkeley Computer Science Department. POSTGRES pioneered many concepts that only became available in some commercial database systems much later.
+
== Creating Moodle Database ==
  
PostgreSQL is an open-source descendant of this original Berkeley code. It supports a large part of the SQL standard and offers many modern features:
+
These instructions assume that the database server and web server are on the same machine. If that is not the case you have some more work to do. See the PostgreSQL documentation for further details.
  
* complex queries
+
* Log into the PostgreSQL command line client. The exact form depends on how your PostgreSQL is configured but will be something like:
* foreign keys
+
<pre>
* triggers
+
$ psql -U postgres
* views
+
Password for user postgres:
* transactional integrity
+
</pre>
* multiversion concurrency control
+
(enter the password for your 'postgres' user set during installation). After some preamble you should see the prompt ''postgres=#''.
Also, PostgreSQL can be extended by the user in many ways, for example by adding new
+
* Create the user for the Moodle database and assign a password:
 
+
<pre>
* data types
+
postgres=# create user moodleuser with password 'yourpassword';
* functions
+
</pre>
* operators
+
...substituting a suitably strong password.
* aggregate functions
+
* Create the database:
* index methods
+
<pre>
* procedural languages
+
postgres=# create database moodle owner moodleuser;
 
+
</pre>
And because of the liberal license, PostgreSQL can be used, modified, and distributed by everyone free of charge for any purpose, be it private, commercial, or academic."
 
  
 
== See also ==
 
== See also ==
Line 30: Line 30:
 
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=49195 Upgrading to 1.6 and may need to switch to PostgreSQL] forum discussion
 
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=49195 Upgrading to 1.6 and may need to switch to PostgreSQL] forum discussion
  
[[Category:Administrator]]
 
[[Category:Developer]]
 
 
[[Category:SQL databases]]
 
[[Category:SQL databases]]
  
 
[[ja:PostgreSQL]]
 
[[ja:PostgreSQL]]

Revision as of 10:05, 8 December 2011

PostgreSQL is one of the two databases that is fully supported by Moodle. A database is a required component of any Moodle installation.

Creating Moodle Database

These instructions assume that the database server and web server are on the same machine. If that is not the case you have some more work to do. See the PostgreSQL documentation for further details.

  • Log into the PostgreSQL command line client. The exact form depends on how your PostgreSQL is configured but will be something like:
$ psql -U postgres
Password for user postgres:

(enter the password for your 'postgres' user set during installation). After some preamble you should see the prompt postgres=#.

  • Create the user for the Moodle database and assign a password:
postgres=# create user moodleuser with password 'yourpassword';

...substituting a suitably strong password.

  • Create the database:
postgres=# create database moodle owner moodleuser;

See also