Скачать в pdf «PostgreSQL»


initdb creates a new Postgres database system. A database system is a collection of databases that are all administered by the same Unix user and managed by a single postmaster.

Creating a database system consists of creating the directories in which the database data will live, generating the shared catalog tables (tables that don’t belong to any particular database), and creating the templatel database. When you create a new database, everything in the templatel database is copied. It contains catalog tables filled in for things like the built-in types.

You must not execute initdb as root. This is because you cannot run the database server as root either, but the server needs to have access to the files initdb creates. Furthermore, during the initialization phase, when there are no users and no access controls installed, Postgres will only connect with the name of the current Unix user, so you must log in under the account that will own the server process.

Although initdb will attempt to create the respective data directory, chances are that it won’t have the permission to do so. Thus it is a good idea to create the data directory before running initdb and to hand over the ownership of it to the database superuser.

d.55 initloeation


initlocation — Create a secondary Postgres database storage area initlocation directory


directory Where in your Unix filesystem do you want alternate databases to go?


initlocation will create directories in the specified place.

Скачать в pdf «PostgreSQL»