...
- Start Synaptic by going to the System menu, then clicking the Administration sub-menu, then Synaptic Package Manager.
- Search Synaptic for postgresql, then scroll down the list of results and select the following packages:
- postgresql-8.2
- pgadmin3
Note Various dependencies will be auto-selected; postgresql-8.2 is a meta-package, so it is comprised entirely of dependencies. If you need to test with other versions, select their meta-packages instead.
Note pgadmin3 is not explicitly required for testing, but it makes it much easier to manage PostgreSQL databases and tablespaces.
- Click Apply to commence package installation.
- When the packages are done installing, open a terminal by going to the Applications menu, then clicking the Accessories sub-menu, then Terminal.
- Start the PostgreSQL server with this command:
Code Block sudo /etc/init.d/postgresql-8.2 start
- Type this command into the terminal to change to the postgres user:
Code Block sudo su postgres -c psql template1
- You'll end up in the psql terminal. psql is the PostgreSQL command line utility, much like mysql is for MySQL. Type this in to set the postgres root password:
Code Block ALTER USER postgres with PASSWORD 'password';
Note This will set the postgres user's password to password, which suits our internal testing purposes. Please change this to a secure password for production systems.
- Now type \q to quit the psql command line environment.
- Next you need to set the postgres system user's password. This is not the same user as the internal postgres root user that you just set. The PostgreSQL database server must run on its own system user account. In this case, as is customary, PostgreSQL runs as a user named <b>postgres</b>. Type this in to set the password:
Code Block sudo passwd postgres
- You will be prompted for a user password for postgres. Again, for testing purposes, enter <b>password</b> for the password.
...