Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gCKFi-0008Kl-BZ for pgsql-general@arkaria.postgresql.org; Tue, 16 Oct 2018 07:58:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gCKFg-0002ca-2L for pgsql-general@arkaria.postgresql.org; Tue, 16 Oct 2018 07:58:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gCKFf-0002cT-Qe for pgsql-general@lists.postgresql.org; Tue, 16 Oct 2018 07:58:51 +0000 Received: from mx1.mailbox.org ([80.241.60.212]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gCKFd-000278-Ed for pgsql-general@lists.postgresql.org; Tue, 16 Oct 2018 07:58:51 +0000 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.mailbox.org (Postfix) with ESMTPS id 6E1F64058E; Tue, 16 Oct 2018 09:58:48 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by hefe.heinlein-support.de (hefe.heinlein-support.de [91.198.250.172]) (amavisd-new, port 10030) with ESMTP id 5ra4HgofhIOV; Tue, 16 Oct 2018 09:58:46 +0200 (CEST) Message-ID: <6f6b9febf25df823552b0d80c5eff9eeccf628d4.camel@cybertec.at> Subject: Re: Problem creating a database From: Laurenz Albe To: Joshua White Cc: pgsql-general@lists.postgresql.org Date: Tue, 16 Oct 2018 09:58:45 +0200 In-Reply-To: References: Organization: Cybertec Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Please don't top post. Joshua White wrote: > On Mon, 15 Oct 2018 at 21:13, Laurenz Albe 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 -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