Create Postgres Multiple Instance on Same Server
Step 1 : Initialize Database Directory
initdb -D /<path_of_data_directory> Suppose User want to initialize new data directory at 2 location Path1: /opt/Data1 Path2: /opt/Data2 First Create Data1 Diectory & Data2 Diectory > mkdir Data1 > mkdir Data2 Initialize Now > initdb -D /opt/Data1 > initdb -D /opt/Data2
Step 2 : Start Database Instance
#Now start database first instance on port 5432
pg_ctl -D /opt/Data1 -o "-p 5432" -l /log_path_logdb1 start
#Now start database Second instance on port 5433
pg_ctl -D /opt/Data2 -o "-p 5433" -l /log_path_logdb2 start