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 6782031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:41:36+00:00 2026-05-26T16:41:36+00:00

Final update: I had forgotten to run the initdb command. By running this command

  • 0

Final update:

I had forgotten to run the initdb command.


By running this command

ps auxwww | grep postgres

I see that postgres is not running

> ps auxwww | grep postgres
remcat          1789   0.0  0.0  2434892    480 s000  R+   11:28PM   0:00.00 grep postgres

This raises the question:

How do I start the PostgreSQL server?

Update:

> pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
sh: /usr/local/var/postgres/server.log: No such file or directory

Update 2:

The touch was not successful, so I did this instead:

> mkdir /usr/local/var/postgres
> vi /usr/local/var/postgres/server.log
> ls /usr/local/var/postgres/
server.log

But when I try to start the Ruby on Rails server, I still see this:

Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?

Update 3:

> pg_ctl -D /usr/local/var/postgres status
pg_ctl: no server running

Update 4:

I found that there wasn’t any pg_hba.conf file (only file pg_hba.conf.sample), so I modified the sample and renamed it (to remover the .sample). Here are the contents:

 # IPv4 local connections:
 host    all             all             127.0.0.1/32           trust
 # IPv6 local connections:
 host    all             all             ::1/128                trust

But I don’t understand this:

> pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
server starting
> pg_ctl -D /usr/local/var/postgres status
pg_ctl: no server running

Also:

sudo find / -name postgresql.conf
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory

Update 5:

sudo pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Password:
pg_ctl: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.

Update 6:

This seems odd:

> egrep 'listen|port' /usr/local/var/postgres/postgresql.conf
egrep: /usr/local/var/postgres/postgresql.conf: No such file or directory

Though, I did do this:

>sudo find / -name "*postgresql.conf*"
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
/usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf.sample
/usr/share/postgresql/postgresql.conf.sample

So I did this:

egrep 'listen|port' /usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf.sample
#listen_addresses = 'localhost'        # what IP address(es) to listen on;
#port = 5432                # (change requires restart)
                # supported by the operating system:
                #   %r = remote host and port

So I tried this:

> cp /usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf.sample /usr/local/Cellar/postgresql/9.0.4/share/postgresql/postgresql.conf
> cp /usr/share/postgresql/postgresql.conf.sample /usr/share/postgresql/postgresql.conf

I am still getting the same "Is the server running?" message.

  • 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-05-26T16:41:36+00:00Added an answer on May 26, 2026 at 4:41 pm

    The Homebrew package manager includes launchctl plists to start automatically. For more information, run brew info postgres.

    Start manually

    pg_ctl -D /usr/local/var/postgres start

    Stop manually

    pg_ctl -D /usr/local/var/postgres stop

    Start automatically

    "To have launchd start postgresql now and restart at login:"

    brew services start postgresql


    What is the result of pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start?

    What is the result of pg_ctl -D /usr/local/var/postgres status?

    Are there any error messages in the server.log?

    Make sure tcp localhost connections are enabled in pg_hba.conf:

    # IPv4 local connections:
    host    all    all    127.0.0.1/32    trust
    

    Check the listen_addresses and port in postgresql.conf:

    egrep 'listen|port' /usr/local/var/postgres/postgresql.conf

    #listen_addresses = 'localhost'        # What IP address(es) to listen on;
    #port = 5432                # (change requires restart)
    

    Cleaning up

    PostgreSQL was most likely installed via Homebrew, Fink, MacPorts or the EnterpriseDB installer.

    Check the output of the following commands to determine which package manager it was installed with:

    brew && brew list|grep postgres
    fink && fink list|grep postgres
    port && port installed|grep postgres
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So... this is beyond strange. I had an app that was running perfectly fine
I had this: final public function __construct() { $this->_host = 'ssl://myserver.com'; $this->_porto = 700;
[UPDATE] (when you read my question this is good to know) I had a
Final question for the night. And apologies for the complete noobness of this. I
My final goal is to write the program which can run on the Unix
So the final menu will look something like this: Item B Item B-1 Item
While making some final tests of a class-library that I'm writing for Windows Mobile
This question is expanding on another I had gotten help with via Stackoverflow (
read final edit for solution I'm try update the onclick function of a link
So I'm toying with this code here, and the main objective is to update

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.