Postmaster shuts down after rebuilding database via psql

From: "Averbukh Stella" <Stella(dot)Averbukh(at)arbitron(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Postmaster shuts down after rebuilding database via psql
Date: 2006-06-02 14:32:45
Message-ID: C9995BA6EBD30240A86235B6FCCF5A680E010737@ARBEX2KC.arbitron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I experience following problem. I have postgreSQL installed on sparc10.
During the day, I have to drop and create 100+ tables several times per
day. After I do it in psql, quit it and run my application I get
following error:

could not connect to server: Connection refused
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Before I recreate the database, I do ps -aef | grep postmaster. Bellow
is the output of the ps command.

postgres 2866 1 0 16:21:09 pts/5 0:00
/postgres/bin/postmaster
postgres 2869 2866 0 16:21:11 pts/5 0:00
/postgres/bin/postmaster
postgres 2870 2869 0 16:21:11 pts/5 0:00
/postgres/bin/postmaster
postgres 3391 2581 0 09:34:25 pts/1 0:00 grep postmaster
postgres 2877 2866 0 16:24:41 pts/5 0:00
/postgres/bin/postmaster
postgres 2868 2866 0 16:21:11 pts/5 0:29
/postgres/bin/postmaster
postgres 2890 2866 0 16:51:37 pts/5 0:00
/postgres/bin/postmaster

After database was recreated, I do the same ps command but the output is
completely different. The main postmaster process is gone and there are
couple of subprocesses that are still hanging there.

$ ps -aef | grep postmaster
postgres 3416 1 0 09:54:59 pts/5 0:01
/postgres/bin/postmaster
postgres 3394 1 0 09:35:29 pts/5 0:03
/postgres/bin/postmaster
postgres 2877 1 0 16:24:41 pts/5 0:00
/postgres/bin/postmaster
postgres 3428 2581 0 10:01:53 pts/1 0:00 grep postmaster

When I try to stop postmaster using pg_ctl, it tells me that it can't
stop it because process with pid xxx does not exist. The postmaster.pid
file contains pid of the dead process.

$ more postmaster.pid
2866
/postgres/data
5432001 39

So to successfully restart postmaster, I have to remove the
postmaster.pid file, then kill all other postmaster subprocesses.

Did anybody bump into this problem before and can give me suggestions on
how make it more stable?

Thank you.

Stella Averbukh
_________________________________
Senior Software Lead, Arbitron Inc.
Phone: (410) 312-8387
Fax: (410) 312-8614
e-mail: <mailto:stella(dot)averbukh(at)arbitron(dot)com>

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-06-02 14:49:15 Re: Postmaster shuts down after rebuilding database via psql
Previous Message brian ally 2006-06-02 14:10:31 Re: Querying for strings that match after prefix