Hi Shawn.

Here are some answers ...


Creating a Database Cluster

Before you can do anything, you must initialize a database storage area on 
disk.
We call this a database cluster. (SQL uses the term catalog cluster instead.)
A database cluster is a collection of databases is accessible by a single
instance of a running database server. After initialization, a database 
cluster
will contain a database named template1. As the name suggests, this will be 
used
as a template for subsequently created databases; it should not be used for 
actual work.



In file system terms, a database cluster will be a single directory under 
which
all data will be stored. We call this the data directory or data area. It is 
completely
up to you where you choose to store your data. There is no default, although 
locations
such as /usr/local/pgsql/data or /var/lib/pgsql/data are popular. To 
initialize a database
cluster, use the command initdb, which is installed with PostgreSQL. The 
desired file system
location of your database system is indicated by the -D option, for example

$ initdb -D /usr/local/pgsql/data

Note that you must execute this command while logged into the PostgreSQL user 
account,
which is described in the previous section.

Tip: As an alternative to the -D option, you can set the environment variable 
PGDATA.

initdb will attempt to create the directory you specify if it does not already 
exist.
It is likely that it will not have the permission to do so (if you followed 
our advice
and created an unprivileged account). In that case you should create the 
directory
yourself (as root) and change the owner to be the PostgreSQL user. Here is how
this might be done:

root# mkdir /usr/local/pgsql/data
root# chown postgres /usr/local/pgsql/data
root# su postgres
postgres$ initdb -D /usr/local/pgsql/data



and from another part
    PostgreSQL
    ==========

To allow a bit more access to our server:

/var/lib/pgsql/data/pg_hba.conf

# local    DATABASE  USER  METHOD  [OPTION]
# host     DATABASE  USER  IP-ADDRESS  IP-MASK  METHOD  [OPTION]
# hostssl  DATABASE  USER  IP-ADDRESS  IP-MASK  METHOD  [OPTION]

# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD

local   all         all                                             trust
#host    all         all         127.0.0.1         255.255.255.255   trust
host     all         all         127.0.0.1         255.255.255.255   trust
# Using sockets credentials for improved security. Not available everywhere,
# but works on Linux, *BSD (and probably some others)

#local  all     all     ident   sameuser
local   all     all     trust   sameuser



This is some of the class material i teach at the u of c on open source 
databases ...
Hope it answers your questions.
Cheers
Szemir




_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to