initdb in PostgreSQL
Initdb is used to create a new PostgreSQL database cluster refer to the PostgreSQL documentation for more information. https://www.postgresql.org/docs/9.5/app-initdb.html Syntax: initdb -D <directory location> Steps to create a new database cluster: 1. Create a required directory and make sure it has proper permissions and ownership mkdir -p /u02/client1 -bash-4.2$ ls -ld /u02/client1 drwx------. 15 postgres postgres 4096 Dec 28 20:06 /u02/client1 2. Create the new database cluster using initdb -bash-4.2$ initdb -D /u02/client1 The files belonging to this database system will be owned by user "postgres". This user must also own the server process. The database cluster will be initialized with locale "en_US.UTF-8". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". fixing permissions on existing directory /u02/client1 ... ok creating subdirectories ... ok sele...