pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Joshua White <joshua.white@monash.edu>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Problem creating a database
Date: Tue, 16 Oct 2018 09:58:45 +0200
Message-ID: <6f6b9febf25df823552b0d80c5eff9eeccf628d4.camel@cybertec.at> (raw)
In-Reply-To: <CAGY1NOk=MFvgyjQErd3TR_+FAAOn2O0MNR_q=6udd+L-KU+VHw@mail.gmail.com>
References: <CAGY1NOkYep1Mshow9aZe6wM1YipTYuL09MpR0QHDjcqbOxm0Jg@mail.gmail.com>
	<cedd5ae45b99b0f4fd9b75319700bbc8cf431eec.camel@cybertec.at>
	<CAGY1NOk=MFvgyjQErd3TR_+FAAOn2O0MNR_q=6udd+L-KU+VHw@mail.gmail.com>

Please don't top post.

Joshua White wrote:
> On Mon, 15 Oct 2018 at 21:13, Laurenz Albe <laurenz.albe@cybertec.at> wrote:
> > Joshua White wrote:
> > > I'm hoping someone can point me in the right direction. I've got a PostgreSQL 10 server
> > > instance on CentOS 6, which I set up and manage. I have full admin rights on this machine,
> > > so I can access logs, etc.
> > > 
> > > Recently I attempted to create a new database in this cluster. The command succeeds,
> > > but when I try to connect to the new database, I get a "could not open file" error:
> > > 
> > > psql: FATAL:  could not open file "base/618720/2610": No such file or directory
> > > 
> > > It has been some time since I set up the database, so I don't know how long ago this
> > > became an issue. I can't seem to find any other instances of this problem online either.
> > > The logs are not helpful - even on the highest debug setting, I only see the
> > > "connection authorized" then the fatal "could not open file" error.
> > > 
> > > The data directory is on a separate disk array to the OS. Recently checked it and
> > > there are no disk errors.
> > > 
> > > Any thoughts or ideas would be much appreciated.
> > 
> > Looks like the file backing the "pg_index" table is gone.
> > 
> > Can you check if the file exists in the data directory or not?
>
> Thanks for the tip. I've checked and the on-disk file behind "pg_index" still exists.
>
> I have existing databases in this cluster that I'd prefer not to drop and recreate if possible.
>
> I've tried dropping and recreating the new database I want to use, but each time get the same type of error.

"pg_index" initially uses file 2610.
That may of yourse change if you rewrite the table.

Try the following as OS user "postgres":
   oid2name -d <your database> -f 2610
Then you can see which table is associated to that file.

Anyway, your database seems to be quite wrecked, and you'd probably need
an expert to save what can be saved.

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





view thread (11+ messages)  latest in thread

Message-ID: <6f6b9febf25df823552b0d80c5eff9eeccf628d4.camel@cybertec.at>
Permalink:  ../6f6b9febf25df823552b0d80c5eff9eeccf628d4.camel@cybertec.at/
Also on:    postgresql.org/message-id/6f6b9febf25df823552b0d80c5eff9eeccf628d4.camel@cybertec.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, joshua.white@monash.edu
  Subject: Re: Problem creating a database
  In-Reply-To: <6f6b9febf25df823552b0d80c5eff9eeccf628d4.camel@cybertec.at>
  References: <CAGY1NOkYep1Mshow9aZe6wM1YipTYuL09MpR0QHDjcqbOxm0Jg@mail.gmail.com> <cedd5ae45b99b0f4fd9b75319700bbc8cf431eec.camel@cybertec.at> <CAGY1NOk=MFvgyjQErd3TR_+FAAOn2O0MNR_q=6udd+L-KU+VHw@mail.gmail.com> <6f6b9febf25df823552b0d80c5eff9eeccf628d4.camel@cybertec.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox