Re: error connecting to database: could not open relation - Mailing list pgsql-general

From Scott Marlowe
Subject Re: error connecting to database: could not open relation
Date
Msg-id dcc563d10804240806n3b90486cw3746f9aba67ceaf9@mail.gmail.com
Whole thread Raw
In response to error connecting to database: could not open relation  ("PontoSI - Consultoria, Informática e Serviços LDA" <geral@pontosi.pt>)
List pgsql-general
On Wed, Apr 23, 2008 at 10:44 PM, "PontoSI - Consultoria, Informática
e Serviços LDA" <geral@pontosi.pt> wrote:
>
>  Hi,
>  I've had a server crash on a machine running FreeBSD 6 and PG 8.2.5. The
> database was running at the time of the crash, and probably there was some
> lost data. When I try to start PG in single mode (and width -P) he complains
> that he "could not open relation with OID 2661". Because the file is
> missing, I've tried to create a zeroed file with the size of a page too see
> if we would eat it so I can dump the data, but without success. I've also
> tried pgfsck without any luck.
>  Is there any way to get around the missing files and dump directly the
> values stored inside the actual table files?

You're getting a lot of useful on how to get your database up and
running again.  I'll leave that to the folks you're chatting with.
What you need to do next is figure out how it happened.  On a machine
with solid disk hardware and a properly configured OS this should NOT
ever happen.

The most common cause of this is an IDA / SATA drive with its write
cache enabled in write back mode.  There are other possibilities.

A properly configured database server should be able to survive having
the power cord yanked out in the middle of the busiest period of the
day.

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: error connecting to database: could not open relation
Next
From: Tom Lane
Date:
Subject: Re: plpgsql and logical expression evaluation