Re: Problem creating a database

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Joshua White <joshua(dot)white(at)monash(dot)edu>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Problem creating a database
Date: 2018-10-17 06:19:32
Message-ID: 67e0670089d73d995759725ef42b59cd85ff0d84.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joshua White wrote:
> > > > > > psql: FATAL: could not open file "base/618720/2610": No such file or directory
> > >
> > > "pg_index" initially uses file 2610.
> > >
> > > Anyway, your database seems to be quite wrecked, and you'd probably need
> > > an expert to save what can be saved.
> >
> So you're right about it being seriously corrupted somehow. All my custom databases seem to work fine.
> I have data checksums and amcheck enabled and haven't found any issues using the query below.
>
> SELECT bt_index_check(index => c.oid), c.relname, c.relpages
> FROM pg_index i
> JOIN pg_opclass op ON i.indclass[0] = op.oid
> JOIN pg_am am ON op.opcmethod = am.oid
> JOIN pg_class c ON i.indexrelid = c.oid
> JOIN pg_namespace n ON c.relnamespace = n.oid
> WHERE am.amname = 'btree'
> -- Don't check temp tables, which may be from another session:
> AND c.relpersistence != 't'
> AND i.indisready AND i.indisvalid
> ORDER BY c.relpages DESC;
>
> However, when I went to connect to template1, it failed:
>
> # \connect template1
> FATAL: could not open file "base/1/2610": No such file or directory
> Previous connection kept
>
> If template1 is corrupt, that would explain why I am unable to create new databases.

Right. I think that dumping what you can and importing it in a new cluster
is the way to go.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas Kretschmer 2018-10-17 06:47:19 Re: Which index is used in the index scan.
Previous Message Sakai, Teppei 2018-10-17 05:39:48 Which index is used in the index scan.