Ubuntu & Debian PostgreSQL setup

#File Locations:
Configuration files: /etc/postgresql/[version]/[cluster]/
Binaries: /usr/lib/postgresql/[version]
Data files: /var/lib/postgresql/[version]/[cluster]
# Instaliraj server i dodatni softvare
apt-get install postgresql
apt-get install postgresql-contrib
# Generiraj hr_HR locale
sudo locale-gen hr_HR.UTF-8
# Postavi da se na bazu može spojiti i lokalno pomoću šifre
vi /etc/postgresql/9.1/main/pg_hba.conf
local   all             all                                     password
# Za development, da se može spojiti na server preko TCP/IP protokola
host   all   all  0.0.0.0/0   password
i u postgresql.conf: listen_address = '*'
# Kreiraj superuser korisnika, pita za šifru
createuser -P -s -e myuser
# Kreiraj bazu
createdb -O myuser -E UTF8 -T template0 --locale=hr_HR.utf8 mydb
# Napravi restart PostgreSQL servisa
sudo /etc/init.d/postgresql restart

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.