Leave a comment

Error While starting Postgres in ubuntu

Getting following error while trying  to start postgres

* The PostgreSQL server failed to start. Please check the log output:
2013-05-29 14:29:02 IST FATAL: could not create shared memory segment: Invalid argument
2013-05-29 14:29:02 IST DETAIL: Failed system call was shmget(key=5432001, size=39321600, 03600).
2013-05-29 14:29:02 IST HINT: This error usually means that PostgreSQL’s request for a shared memory segment exceeded your kernel’s SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 39321600 bytes), reduce PostgreSQL’s shared memory usage, perhaps by reducing shared_buffers or max_connections.


The simple solution for above problem is

go to /etc/sysctl.d/30-postgresql-shm.conf  file and  add or change this line in the file

kernel.shmmax = 41943040

and then run the command sudo sysctl -p

now you can start your postgres 🙂


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: