Had little trouble with the postgressql. Check the error in block letters below.
root@server1 [/var/lib/pgsql]# tail -f pgstartup.log
creating template1 database in /var/lib/pgsql/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating conversions … FATAL: could not load library “/usr/lib64/pgsql/utf8_and_euc_kr.so”: /usr/lib64/pgsql/utf8_and_euc_kr.so: failed to map segment from shared object: Cannot allocate memory
STATEMENT: CREATE OR REPLACE FUNCTION euc_kr_to_utf8 (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS ‘$libdir/utf8_and_euc_kr’, ‘euc_kr_to_utf8′ LANGUAGE C STRICT;child process exited with exit code 1
initdb: removing contents of data directory “/var/lib/pgsql/data”
It was bit tricky to solve this issue as I thought library might be having some issues. I even confirmed that the .so file is there in place. I also tried verifying the package postgresql-server which provides the .so file and even reinstalled the same to be in safer side after taking the backups.
But that didn’t help.
So thought of initializing the postgressql database freshly as postgresql user “postgre”. To do this you should run initdb command as mentioned below. Ensure that you empty the content of the directory /var/lib/pgsql/data/.
root@server1 #
su postgres
bash-3.2$initdb /var/lib/pgsql/data/
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_IN.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 /var/lib/pgsql/data … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers/max_fsm_pages … 24MB/153600
creating configuration files … ok
creating template1 database in /var/lib/pgsql/data/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … okWARNING: enabling “trust” authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.Success. You can now start the database server using:
postgres -D /var/lib/pgsql/data
or
pg_ctl -D /var/lib/pgsql/data -l logfile start
Now, its time to restart postgresql :
# /etc/init.d/postgresql start
Starting postgresql service: [ OK ]
And it started working.





