Installation
To install from Ubuntu to run in console the following line:
sudo apt-get install postgresql postgresql-client pgadmin3This installs the engine and pgadmin3 client, a graphical tool to manage databases.
The next thing is to change the administrator password system PostgreSQL:
sudo passwd postgresNow we must change the password of "user postgres" on the engine, it first entered with the following line:
psql -h localhost -U postgres -W template1and then enter the following command:
ALTER USER postgres WITH PASSWORD 'password';Finally out of postgres, enter the following command:
\qWith this we have installed PostgreSQL. Settings
We set up remote access to our motor. This step is optional, only if you want to allow access to our server from other hosts.
First we edit the file postgresql.conf:
sudo gedit /etc/postgresql/8.4/main/postgresql.confLook for the line:
# Listen_addresses = 'localhost'and change it to:
listen_addresses = '*'We also look for the following line:
# Password_encryption = onand change it to:
password_encryption = onNow we edit the file "pg_hba.conf"
sudo gedit /etc/postgresql/8.4/main/pg_hba.conf
Modify the lines:
# Database administrative login by UNIX sockets
local all postgres ident
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all ident
# IPv4 remote connections:
host all all 194.116.73.46/0 md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
We do this to use MD5 authentication with the user postgres.
Finally sent to restart:
sudo /etc/init.d/postgresql-8.4 restartMore information about the configuration: http://www.linux-es.org/node/660
Pgadmin3
The following video shows how to connect to PostgreSQL pgadmin3 and how to use:

Thanks Diego, I've always used MySQL for my local development of jugevents, though postgresql is the db used in production.
RispondiEliminaI hope this post helps me to successfully install postgresql on my netbook running ubuntu, I'll let you know if I succeed with this :)
I have always used PostgreSQL Parancoe! :) If you want to create a post on how to configure it. I've always found it good, at least for now! Do you think there are important differences between MySQL and PostgreSQL?
RispondiEliminaHi!
RispondiEliminaI followed as instructed.. But couldnt find the below lines.
We also look for the following line:
# Password_encryption = on
and change it to:
password_encryption = on
And finally when sudo /etc/init.d/postgresql-8.4 restart
the output goes as
sudo: /etc/init.d/postgresql-8.4: command not found
Please advise.
Thanks in advance.
Hello, probably you are not properly installed PostgreSQL, or you installed a different version. You should try to see what version you have installed.
RispondiEliminaSo you need to start postgresql execute a different command:
sudo /etc/init.d/postgresql restart-XXX
Try to write: sudo /etc/init.d/postgresql .. and press the TAB key to auto-completion.
Regarding the line that you can not find, it's really weird. control well. But you have a blank file? maybe you were wrong file because you have a different version:
sudo gedit/etc/postgresql/XXX/main/postgresql.conf
$ sudo apt-get install postgresql postgresql-client pgadmin3
RispondiEliminaReading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package postgresql
E: Unable to locate package postgresql-client
E: Unable to locate package pgadmin3