Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8533089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:52:36+00:00 2026-06-11T09:52:36+00:00

I’m trying to switch over from sqlite3 to PostgreSQL for development in Rails so

  • 0

I’m trying to switch over from sqlite3 to PostgreSQL for development in Rails so that I don’t have any heroku problems. I was following the advice given on heroku and a linked-to Railscast, but I ran into the following error after brew installing postgresql.

creating template1 database in /usr/local/var/postgres/base/1 …

FATAL: could not create shared memory segment: Cannot allocate memory

DETAIL: Failed system call was shmget(key=1, size=2072576, 03600).

HINT: This error usually means that PostgreSQL’s request for a shared memory segment exceeded available memory or swap space, or
exceeded your kernel’s SHMALL parameter. You can either reduce the
request size or reconfigure the kernel with larger SHMALL. To reduce
the request size (currently 2072576 bytes), reduce PostgreSQL’s shared
memory usage, perhaps by reducing shared_buffers or max_connections.

I’ve poked around the doc a bit, but I’m new to this and know very little about memory and how databases work, and I figured that someone here might be able to point me in the right direction a lot better than I could find it myself. Any idea how to fix this? My computer is new and relatively fancy, and I’d be surprised if it ran out of memory for this, so I don’t know if reducing “shared memory usage” is the right idea (if I understand what’s going on at all).

Edit: Should have put this up earlier. This is the command (building the database) that led to the error:

initdb /usr/local/var/postgres -E utf8
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T09:52:37+00:00Added an answer on June 11, 2026 at 9:52 am

    From the database path, I guess you are using Mac OS X.

    Since most popular Linux distros has a database directory reside in /var/lib.

    After some search on Google, I found this:
    Fixing the postgresql initdb fatal shared memory error on Leopard

    Hope it help.

    I copied those instructions from the link above for your convenience.

    Run these command:

    sudo sysctl -w kern.sysv.shmall=65536
    sudo sysctl -w kern.sysv.shmmax=16777216
    

    Or edit /etc/sysctl.conf for permanent changes

    kern.sysv.shmall=65536
    kern.sysv.shmmax=16777216 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I have a view passing on information from a database: def serve_article(request, id): served_article
I am trying to loop through a bunch of documents I have to put
I have a bunch of posts stored in text files formatted in yaml/textile (from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.