see this getting started doc

creating users, creating a db

# su postgres
bash-3.1$ createuser root
could not change directory to "/root"
Shall the new role be a superuser? (y/n) y
CREATE ROLE
# exit
# createdb postgres_test
CREATE DATABASE
# psql postgres_test
Welcome to psql 8.1.4, the PostgreSQL interactive terminal.
...
postgres_test=# SELECT version();
                                                         version 
-------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 8.1.4 on i386-redhat-linux-gnu, compiled by GCC i386-redhat-linux-gcc (GCC) 4.1.0 20060304 (Red Hat 4.1.0-3)
(1 row)

postgres_test=#

( also can dropdb [database] )

Changing a password

  • alter USER some_user with password 'some_password';

Enabling remote access

  • in /var/lib/pgsql/data/postgresql.conf, uncomment the listen_addresses ( sed --in-place=_old 's/#[ ]*listen_addresses[ ]*=/listen_addresses/g' /var/lib/pgsql/data/postgresql.conf )
  • in /var/lib/pgsql/data/pg_hba.conf add a line like this: host all all 192.168.0.0/16 md5

-- MattWalsh - 19 Dec 2006

Topic revision: r3 - 03 Jan 2007 - MattWalsh
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback