> PG> [2018-10-29 15:51:30 UTC]STATEMENT: INSERT INTO ... RETURNING inserted
> PG> [2018-10-29 15:52:05 UTC]FATAL: database "db" does not exist
> PG> [2018-10-29 15:52:05 UTC]DETAIL: The database subdirectory
> PG> "pg_tblspc/1932420460/PG_10_201707211/16400" is missing.
>
> What is in the pg_database row (especially the dattablespace column) for
> that database?
Well, that can't be good:
psql (10.1)
Type "help" for help.
root=# select * from pg_database;
ERROR: cache lookup failed for type 0
I get that both on the original system (running 10.1) and on my
up-to-date system that's running 10.5.