PostgreSQL cluster initialization is basically creation of an initial file structure to store DB files in. Unix-based systems usually save the DB in /var/lib/postgres. The Windows installer asks for a destination folder during the process of installation.

We recommend to select UTF8 option as server encoding.

Manual DB initialization is done by launching initdb utility (from postgresql package) with, for example, the following parameters:

initdb --username=postgres --pwprompt -E UTF8 /mnt/raid/db

This command creates a primary database in /mnt/raid/db folder with postgres as administrator’s account. On creation you are asked to set a password for the new DB administrator.

Warning

After the directory is created, make sure that Postgres user account (usually it is called postgres), has a read/write permission in this directory. For Unix it is recommended to assign the user to be the owner of the directory.

<< Previous Next >>

Did this answer your question?