Re: BUG #15467: The database subdirectory "pg_tblspc/1932420460/PG_10_201707211/16400" is missing.

From: tsuraan <tsuraan(at)gmail(dot)com>
To: andrew(at)tao11(dot)riddles(dot)org(dot)uk
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15467: The database subdirectory "pg_tblspc/1932420460/PG_10_201707211/16400" is missing.
Date: 2018-10-31 14:30:26
Message-ID: CALKcMwLFvyAC6C6TAai9OQf3npNu1HAw9SPjs=6YYZHyT54FHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> Does that error persist if you delete all files named pg_internal.init
> in the data dir? (those files are a cache of the system tables and are
> regenerated on the next new connection if they are missing)

There were a few of those files, so I removed them:

$ find data -name pg_internal.init
data/base/1/pg_internal.init
data/base/16401/pg_internal.init
data/base/12292/pg_internal.init
data/base/12291/pg_internal.init
data/base/16402/pg_internal.init
data/global/pg_internal.init
$ find data -name pg_internal.init -exec rm {} \;
$ find data -name pg_internal.init
$

Starting up postgres again and querying pg_database still gives the
same cache lookup error.

Another person noticed that the missing directory
(pg_tblspc/1932420460/PG_10_201707211/16400) corresponded to an
existing directory under data/base/16400, so he copied the contents
from data/base/16400 into pg_tblspc/1932420460/PG_10_201707211/16400
(making the previously non-existent parent path
"pg_tblspc/1932420460/PG_10_201707211/" along the way). Doing that
allowed the main database to once again be queried, and all the data
appears to be present. That system still can't query its pg_databases
table, so I assume it's still pretty badly broken, but at least we can
try a pg_dump and recovery onto a new, clean, system. I still have my
copy of the broken database though, and I'd love to know if there's a
proper fix for it, so I'll keep this discussion going as long as
anybody has ideas :)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andrew Gierth 2018-10-31 15:53:25 Re: BUG #15467: The database subdirectory "pg_tblspc/1932420460/PG_10_201707211/16400" is missing.
Previous Message Jim Finnerty 2018-10-31 13:40:07 Re: BEFORE triggers that return NULL can circumvent referential integrity