http://www.entropy.ch/software/macosx/postgresql/

On Mac OS X version 10.4: Download and install the package pgsql-8.2.3.pkg.tar.gz
Create a new user in the Users System Prefs pane:
Name: PostgreSQL User
Short Name: postgres
Password: whatever you want

Open a terminal window and type in the following commands:

sudo chown -R postgres /usr/local/pgsql/ 
enter administrator password when asked

su - postgres
enter the password of the newly created postgres user when asked

/usr/local/bin/initdb -E UTF8 -D /usr/local/pgsql/data 
and wait for the operation to complete

/usr/local/bin/pg_ctl -D /usr/local/pgsql/data -l postgres.log start

Now you can create a test database with 
/usr/local/bin/createdb test

Use it with 
/usr/local/bin/psql test


Liste von Datenbanken anzeigen: \l   (oder: select datname from pg_database;)

CREATE ROLE admin CREATEDB CREATEROLE CREATEUSER LOGIN PASSWORD 'admin'

Um Zugriff vom Netz aus zuzulassen, muss man:
- in der Datei /usr/local/pgsql/data/postgresql.conf d listen_address = '*' eintragen.
- in die Datei /usr/local/pgsql/data/pg_hba.conf folgende Eintraege hinzufuegen:
host    all         all         0.0.0.0/0             trust
host    all         all         ::1/0                 trust
 danach den Server neu starten mit: /usr/local/bin/pg_ctl reload -D /usr/local/pgsql/data/

http://www.postgresql.org/docs/8.2/static/auth-pg-hba-conf.html


Liste der Datenbanken anzeigen: \l
Eine Datenbank verwenden: \c dbname
Liste der Tabellen anzeigen: \dt
