Reputation: 60818
Per Postgresapp.com
psql is the PostgreSQL command-line interface to your database. Mac OS 10.7 ships with an older version of PostgreSQL, which can be started with the following command:
$ psql -h localhost
So I run psql -h localhost
and get
Dans-MacBook-Pro:~ djechlin$ psql -h localhost
psql: 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?
As far as I can tell psql
is simply client side, and Postgresapp.com's documentation is talking smack. I still have no idea how to start a postgres server locally and haven't been able to find any documentation on that.
Version:
Dans-MacBook-Pro:~ djechlin$ psql --version
psql (PostgreSQL) 9.1.5
contains support for command-line editing
I'm on Mac 10.8.4.
Upvotes: 0
Views: 2030
Reputation: 2278
Try changing to postgres user and open psql prompt
sudo -u postgres psql postgres
From here you can create more roles, databases, etc and connect to what you created from whatever you're trying to connect from.
Here is a useful cheat-sheet of commands I have often referred to:
http://blog.jasonmeridth.com/posts/postgresql-command-line-cheat-sheet/
Upvotes: 0
Reputation: 60818
This was admittedly more confusing than it should have been, but...
pg_ctl
is the command usually responsible for starting the postgres server. OS X does not come bundled with it. How to run it is explained in this pre-Postgres.app answer.Upvotes: 1