I have this notorious problem: at some point pgsql simply hangs up and requires a restart.

----------------------------------------------------------------------------------
debian:/usr/share/doc/postgresql-contrib# /etc/init.d/postgresql restart
Restarting PostgreSQL database: postmaster
Stopped /usr/lib/postgresql/bin/postmaster (pid 13820 13822 13824 13826).
Starting PostgreSQL postmaster.
postmaster successfully started
.
debian:/usr/share/doc/postgresql-contrib#
----------------------------------------------------------------------------------

Whenever i restart the server i get a long list of pid's - sometimes its many lines.

I wrote a little script to restart, vacuum and analyze the database. And although the script runs, there are no results. i have to restart the db manualy... any ideas?