Re:

From: Raghavendra <raghavendra(dot)rao(at)enterprisedb(dot)com>
To: daflmx <daflmx(at)qq(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re:
Date: 2011-11-10 08:13:51
Message-ID: CA+h6AhiqvjAMT381OLE7_egdUfQV6V62R4trSTws167wA23oig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Nov 10, 2011 at 1:24 PM, daflmx <daflmx(at)qq(dot)com> wrote:

> Hello,all.
> I have installed the postgresql .
> $/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
> LOG:database system was shut down at 2011-11-10 15:36:14 CST
> LOG:database system is ready to accept connections
> LOG:autovacuum launcher started
>

To start/stop use pg_ctl utility which has good options.
Eg:-
$/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data start
$/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data stop

http://www.postgresql.org/docs/9.1/static/app-pg-ctl.html

but when I want to connect to the server at another terminal
> $/usr/local/pgsql/bin/createdb mydb
> createdb:could nto connect to database postgres:could not connect to
> server:No such file or directory
> Is the server running locally and accepting connections on Unix domain
> socket"/var/run/postgresql/.s.PGSQL.5432"?
>

I don't think you are trying to connect to the database, however you are
creating the database in a cluster.
For connection you need to use below command:-
Eg:-
$/usr/local/pgsql/bin/psql -U postgres -p 5432 -d postgres

http://www.postgresql.org/docs/9.1/static/app-psql.html

$/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
> FATAL:lock file "postmaster.pid"already exists
> HINT: Is another postmaster(PID 1950)running in data directory
> "/usr/local/pgsql/data"?
>

This tell you cluster is already up and running and ready to accept
connections.
You can know the status of cluster whether running or not by below command.
Eg:-
$/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data status.

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

In response to

  • at 2011-11-10 07:54:06 from daflmx

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2011-11-10 09:02:36 Re: count (DISTINCT field) OVER ()
Previous Message Csaba Nagy 2011-11-10 08:09:06 Re: Foreign Keys and Deadlocks