Postgres installation fails

Document ID : KB000031796
Last Modified Date : 14/02/2018
Show Technical Document Details

Symptoms:

Postgres installation fails. In the <Introscope Enterprise Manager>/install/IIntroscope_x.x.x.x_InstallLog.log, you find the below messages:


Create Database Failed

                          Status: ERROR

                          Additional Notes: ERROR - createdb: database creation failed: ERROR:  encoding "UTF8" does not match locale "en_GB"

DETAIL:  The chosen LC_CTYPE setting requires encoding "LATIN1".

(STDOUT: setting path from dbinstalldir /opt/database

PATH is /opt/database/postgres/9.2-pgdg/bin/64:/opt/database/bin:/usr/xpg4/bin:/sbin:/usr/sbin:/bin:/usr/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin

LD_LIBRARY_PATH is /opt/database/postgres/9.2-pgdg/lib/64:/opt/database/lib:

Creating user admin

CREATE ROLE

Creating database cemdb with the admin user as the owner.

)

 

Environment: 

Applies to : Unix only

 

Cause:

The Current LANG setting is different from the default LANG used by Postgres installer.

 

Resolution:


Option A: Change the LANG for only the postgres user account:


1. Uninstall Postgres. Make sure there are no postgres processes running in background, you can use the below command to verify this condition:

ps -ef | grep postgres

2. Remove any remaining files and folders from the postgres home directory, by default: /opt/database (Do not delete this main folder)

3. Do not delete the postgres user and group.

4. You need to create the posgres user profile file in the user home directory. To find out the postgre home directory open the /etc/passwd. Here is an example:

more /etc/passwd | grep postgres

postgres:x:501:501:PostgreSQL:/opt/database:/bin/bash

5. Run vi /opt/database/.profile, add the below line and save the file.

export LANG="en_GB"

6. Launch the Enterprise Manager installer again as a root and install postgres.

 

Option B: Change the LANG environment variable as a global setting.

1. Login as root.

2. Uninstall Postgres. Make sure there are no postgres processes running in background, you can use the below command to verify this condition:

ps -ef | grep postgres

3. Remove the entire postgres home directory, by default: /opt/database

4. Delete the postgres user and group.

5. Open /etc/profile, add the below line and save the file.

export LANG="en_GB"

6. Launch the Enterprise Manager installer again as a root and install postgres.