pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feed(no subject)
4+ messages / 4 participants
[nested] [flat]
* (no subject)
@ 2011-11-10 07:54 daflmx <daflmx@qq.com>
2011-11-10 08:13 ` Re: Raghavendra <raghavendra.rao@enterprisedb.com>
2011-11-10 14:51 ` Re: Tom Lane <tgl@sss.pgh.pa.us>
2011-11-10 16:57 ` Re: John R Pierce <pierce@hogranch.com>
0 siblings, 3 replies; 4+ messages in thread
From: daflmx @ 2011-11-10 07:54 UTC (permalink / raw)
To: pgsql-general
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
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"?
$/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"?
I don't know how to slove this problem,I wish you can tell me the reason.Thanks .
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re:
2011-11-10 07:54 (no subject) daflmx <daflmx@qq.com>
@ 2011-11-10 08:13 ` Raghavendra <raghavendra.rao@enterprisedb.com>
2 siblings, 0 replies; 4+ messages in thread
From: Raghavendra @ 2011-11-10 08:13 UTC (permalink / raw)
To: daflmx <daflmx@qq.com>; +Cc: pgsql-general
On Thu, Nov 10, 2011 at 1:24 PM, daflmx <daflmx@qq.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/
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re:
2011-11-10 07:54 (no subject) daflmx <daflmx@qq.com>
@ 2011-11-10 14:51 ` Tom Lane <tgl@sss.pgh.pa.us>
2 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2011-11-10 14:51 UTC (permalink / raw)
To: daflmx <daflmx@qq.com>; +Cc: pgsql-general
"=?ISO-8859-1?B?ZGFmbG14?=" <daflmx@qq.com> writes:
> [ server is running but ]
> $/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"?
That last line shows that psql (or more specifically, the libpq.so
shared library) thinks it should connect to a local socket file at
/var/run/postgresql/.s.PGSQL.5432. However, the common location
for Postgres' local socket file is /tmp/.s.PGSQL.5432. I suspect
if you look in /tmp, you'll find that the server did create a
socket file there.
In short: this problem occurs because you have a postmaster built one
way and a client library built for a different convention. You could
force things with the -h switch to psql, but it would be more convenient
to be using postmaster and client library from the same distribution.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re:
2011-11-10 07:54 (no subject) daflmx <daflmx@qq.com>
@ 2011-11-10 16:57 ` John R Pierce <pierce@hogranch.com>
2 siblings, 0 replies; 4+ messages in thread
From: John R Pierce @ 2011-11-10 16:57 UTC (permalink / raw)
To: pgsql-general
On 11/09/11 11:54 PM, daflmx wrote:
> I have installed the postgresql .
> $/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
> .....
What version of postgres?
What installation method? (compile from source? install prebuilt binary
from where?)
What operating system version and distribution?
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2011-11-10 16:57 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-11-10 07:54 daflmx <daflmx@qq.com>
2011-11-10 08:13 ` Re: Raghavendra <raghavendra.rao@enterprisedb.com>
2011-11-10 14:51 ` Re: Tom Lane <tgl@sss.pgh.pa.us>
2011-11-10 16:57 ` Re: John R Pierce <pierce@hogranch.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox