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

  • SEARCH
  • Home
  • 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 7523721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:53:06+00:00 2026-05-30T02:53:06+00:00

I downloaded PostgreSQL from the official website and ran the .dmg installer. After that

  • 0

I downloaded PostgreSQL from the official website and ran the .dmg installer. After that I downloaded pgadmin3 and I am indeed able to connect to the database.

when I run ‘psql’ I get the following error:

psql: could not connect to server: No such file or directory
    Is the server running locally and accepting

After hours of googling I read about some $PATH issues, so I put this into my .bashrc:

export PATH=/Library/PostgreSQL/9.1/bin:$PATH

However, this doesn’t solve the error above at all. After some more hours of googling I tried to run ‘psql -l localhost -U postgres’. This gives another error:

psql: could not connect to server: Connection refused
    Is the server running on host "localhost" (::1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (127.0.0.1) and accepting
    TCP/IP connections on port 5432?
could not connect to server: Connection refused
    Is the server running on host "localhost" (fe80::1) and accepting
    TCP/IP connections on port 5432?

After some more googling I tried to edit /Library/PostgreSQL/9.1/data/pg_hba.conf and replaced all occurrences of ‘md5’ with ‘trust’.

Then I changed user to postgres and executed ‘pg_ctl stop’ and ‘pg_ctl start’, switched back to my own user and tried to connect again, no luck.

Here are some more infos:

[~]$ which psql
/Library/PostgreSQL/9.1/bin/psql

ps aux | grep postgres
postgres       19022   0.0  0.0  2446096    484   ??  Ss   11:31PM   0:00.01 postgres: stats collector process   
postgres       19021   0.0  0.0  2486532   1776   ??  Ss   11:31PM   0:00.01 postgres: autovacuum launcher process   
postgres       19020   0.0  0.0  2486400    576   ??  Ss   11:31PM   0:00.03 postgres: wal writer process   
postgres       19019   0.0  0.0  2486400    820   ??  Ss   11:31PM   0:00.05 postgres: writer process   
postgres       19017   0.0  0.0  2446096    356   ??  Ss   11:31PM   0:00.01 postgres: logger process   
postgres       19015   0.0  0.1  2486400   8216 s001  S    11:31PM   0:00.17 /Library/PostgreSQL/9.1/bin/postgres

sudo find / -name .s.PGSQL.5432
No file was found?!?

Update 1:
In /etc/sysctl.conf I added the values suggested by the installer’s README:

kern.sysv.shmmax=1610612736
kern.sysv.shmall=393216
kern.sysv.shmmin=1
kern.sysv.shmmni=32
kern.sysv.shmseg=8
kern.maxprocperuid=512

Before these settings, the installer quits with an error, afterwards the wizard appears and installs postgres (and again, using pgadmin3 works, so I assume that the database is running fine).

  • 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-30T02:53:08+00:00Added an answer on May 30, 2026 at 2:53 am

    Run lsof on the master process to all of this. In your case it’s 19015 (shown with my PID):

    > sudo lsof -p 286 | awk '$5 == "unix" && $NF ~ /\// { print $NF }' 
    /tmp/.s.PGSQL.5432
    

    You can leave off the awk, but basically it’s getting the UNIX socket on which postgres is listening. From there, you can use the -h option to psql (but only include the directory).

    > psql -h /tmp template1                                                                                                                                                                                                                                                            
    template1=# \q
    

    If that doesn’t work, you can check the lsof output to show you what TCP port it’s actually listening on, and if it’s not 5432, use the -p option to postgres

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Npgsql to connect to the postgresql database from visual studio 2010.
I downloaded the developerkit from fastcgi.com. The kit has an examples folder that has
I am working on a function for a PostgreSQL database, that when client issues
I'm trying to connect to a remote PostgreSql database using powershell. This is my
Having downloaded Pango and GLib from the GTK+ Project's Win32 downloads page and having
I downloaded the Gson library from http://code.google.com/p/google-gson/ . The archive contains the following jar
I downloaded the DotNetNuke Visual Studio Installer, and the only project template I got
I need to create an application for the iPhone that will connect to a
I downloaded the shape data from OSM. I have imported data from Shapefile into
I've downloaded a source code from internet and I'm trying to build it with

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.