Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

When I try to start the postgres server with sudo /etc/init.d/postgresql start I get this error:

Starting PostgreSQL 8.4 database server: mainThe PostgreSQL server failed to start. Please check the log output: 2012-10-31 17:52:46 EDT FATAL: could not create shared memory segment: Invalid argument 2012-10-31 17:52:46 EDT DETAIL: Failed system call was shmget(key=5432001, size=188080128, 03600). 2012-10-31 17:52:46 EDT 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 188080128 bytes), reduce PostgreSQL's shared_buffers parameter (currently 19200) and/or its max_connections parameter (currently 103). If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for. The PostgreSQL documentation contains more information about shared memory configuration. ... failed!

What should I do here? Shared_buffers is actually set to 150MB and max_connections is actually set to 100 in the only postgresql.conf file available to it...

I don't know if the request is unusually high, SHMMAX unusually low, or if postgres grabbed some config parameters from the Aether, either seem equally likely...

What am I supposed to make of this, and how do I fix it?

share|improve this question
    
Search for the error message, or read it - it explains what to do. stackoverflow.com/… or google.com.au/… . –  Craig Ringer Nov 1 '12 at 0:26
    
possible duplicate of postgresql shared memory settings –  Craig Ringer Nov 1 '12 at 0:27
add comment

migrated from stackoverflow.com Nov 1 '12 at 13:57

This question came from our site for professional and enthusiast programmers.

1 Answer

This question has been asked many times. Try a search. Or Google.

This chapter of the manual deals with it comprehensively.

share|improve this answer
1  
Linking to /current/interactive may not be ideal here, because shared memory configuration changed considerably in PostgreSQL 9.3 with the switch to anonymous mmap-ed memory instead of system V shm, so this link will cease to apply when 9.3 becomes /current/. –  Craig Ringer Nov 1 '12 at 0:29
    
@CraigRinger: Good point. Also, the question is for PostgreSQL 8.4 explicitly. Changed link to 8.4. –  Erwin Brandstetter Nov 1 '12 at 0:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.