Re: postmaster.pid

From: Joerg Hessdoerfer <Joerg(dot)Hessdoerfer(at)sea-gmbh(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: postmaster.pid
Date: 2003-01-03 16:26:56
Message-ID: 20030103161210.E99084980D4@sea-gw.sea.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

On Friday 03 January 2003 18:38, you wrote:
> > > i think that somewhere in the docs the administators
> > > should be advised to delete postmaster.pid automatically at boot
> > > time ( for example at the same time when the files in /tmp are
> > > deleted ).
> > > This way, in case of an unexpected shutdown, postgresql would be
> > > able to restart without any manual intervention.
> >
> > Well, this is a *BAD IDEA*. Suppose, for example, your data is corrupt in
> > some special way, an due to your removal of the pid file, postmaster
> > tries to recover the database automatically and probably destroys all or
> > data part of the data. You would like to have been able to do a
> > filseystem level backup first...
>
> Ooopss... it seems like i am too optimistic about such situations.
>
> Just wondering: if the database is so heavily damaged that the
> postmaster would not be able to recover, are there any chances to
> restore anything from a filesystem backup, manually ?
>

With a lot of work, sometimes... it all depends of how much the data is worth
to (read: when did you do you last backup? ;-)

> .........
>
> Background:
> - our team is working on a project for a small company.
> - there will be one server and 3-4 clients
> - It is the first time we use PostgreSQL.
> - Little space.
> - Many people around.
> - No UPS (yet).
> - unpredictable,untrained,desperate,'crazy' users
>
> Possible problems:
> - the users will need time to learn how to use the program
> ( until then they could do many mistakes, such as turning off the
> server before leaving the office - without issueing the proper
> shutdown command, but simply pushing the power switch. )
> - someone might stumble over the cable and unplug the server by mistake.
>

Why should someone switch off a server at all? Except for maintenance or
repair?

> Questions:
> How resistent is PostgreSQL to such shocks?
>
It never failed me after a crash. But I don't push it... (I can remember only
3 crashes at all, and these were NOT PostgreSQL's fault!)

> Are there alternative solutions to handling unexpected shutdowns
> automatically? (except deleting postmaster.pid at boot time)
>

The best idea for your situation seems to be the advice: make automated
backups as often as possible, to avoid too much data loss. Then you could go
the route of 'delete pid file automatically'.

If a really bad thing happens, you can always restore from tha last backup.

>
>
> Best wishes,
>
> Adrian Maier
> (am(at)fx(dot)ro)
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

HTH,
Joerg
--
Leading SW developer - S.E.A GmbH
Mail: joerg(dot)hessdoerfer(at)sea-gmbh(dot)com
WWW: http://www.sea-gmbh.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jean-Luc Lachance 2003-01-03 16:48:10 Field with default not being set on copy from.
Previous Message Joerg Hessdoerfer 2003-01-03 16:18:52 Re: postmaster.pid