First, check your USE flags.
Then :
# emerge postgresql
Addd a password :
# passwd postgres
and finish the install :
emerge --config =postgresql-8.1.8
Install the package :
apt-get install postgresql-8.1
Change the new postgres user password with passwd command, as root.
Start the database daemon :
# /etc/init.d/postgresql-8.1 start
At the moment, only the postgres user can log in the database server. To be able to use your own unix account, you have to had it :
stan@hermes:~/djangoprojects/portageproject$ su postgres Password: postgres@hermes:/home/stan/djangoprojects/portageproject$ createuser stan Shall the new role be a superuser? (y/n) y CREATE ROLE postgres@hermes:/home/stan/djangoprojects/portageproject$ exit exit
Now you can create your own database :
stan@hermes:~/djangoprojects/portageproject$ createdb portage CREATE DATABASE stan@hermes:~/djangoprojects/portageproject$
To use the client and connect to the new database :
Password:
Welcome to psql 8.1.8, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
portage=#
As root :
/etc/init.d/postgresql start
Actually, there is only one user, postgres, so :
stan@hermes ~/Bommings/bommings-dev $ createdb -U postgres -W myfirstprojectdb Mot de passe : CREATE DATABASE stan@hermes ~/Bommings/bommings-dev $
TODO
To connect to a database djangodb :
stan@hermes ~/django/mysite $ psql -U postgres -W djangodb
Mot de passe pour l'utilisateur postgres :
Bienvenue dans psql 8.1.8, l'interface interactive de PostgreSQL.
Tapez: \copyright pour les termes de distribution
\h pour l'aide-mémoire sur les commandes SQL
\? pour l'aide-mémoire sur les commandes psql
\g ou terminez avec un point-virgule pour exécuter une requête
\q pour quitter
djangodb=#
First we have to create account for normal user