Previously, we have been able to install Linux and configure it on our Raspberry PI. It is now the moment to turn our Raspberry PI into Raspberry PG, by installing PostgreSQL 9.3.
First, you need to instruct APT (Debian’s package manager) to use the PostgreSQL Community package repository. You can find detailed instructions for the installation process of the new PostgreSQL version (9.3) in the PostgreSQL Apt repository documentation. Here we just summarise the principal steps:
/etc/apt/sources.list.d/pgdg.listfile with the following command ( Raspbian is a Debian wheezy system):
deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main
- Import the repository key, update the package lists, and start installing packages:
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.3
This is enough to install PostgreSQL 9.3. During the installation, the user “postgres” will be created (with home directory in
/var/lib/postgresql/). Usually in a Raspbian version (such as in Debian/Ubuntu versions) PostgreSQL configuration files are stored in
/etc/postgresql/9.3/main/, and data directory is stored in
/usr/local/var/postgres/. Now is possible to Start/Stop/Restart the postmaster (the main process of a PostgreSQL server) using the command:
sudo service postgresql start|stop|restart
While tweaking the configuration file parameters, keep in mind that most of the changes should require a postmaster restart.
Since many things are changed during all this time, we decided to write several new blog article with the updates.
A first, excellent article has been written by my dear friend Rubens, explaining how to install PostgreSQL both on RaspberryPI and RaspberryPI2 with the last release of Raspbian. I invite all of you to read it.
Other blog articles will be written showing the differences between the old results and the ones achievable with the new RaspberryPI’s. Stay tuned!