Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a1M0h-0004F6-L6 for pgsql-sql@arkaria.postgresql.org; Tue, 24 Nov 2015 22:24:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a1M0h-0007uR-2o for pgsql-sql@arkaria.postgresql.org; Tue, 24 Nov 2015 22:24:27 +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.84) (envelope-from ) id 1a1M0g-0007uK-Kj for pgsql-sql@postgresql.org; Tue, 24 Nov 2015 22:24:26 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a1M0d-0007oW-NA for pgsql-sql@postgresql.org; Tue, 24 Nov 2015 22:24:26 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id tAOMOH51000367; Tue, 24 Nov 2015 17:24:17 -0500 From: Tom Lane To: Alvaro Herrera cc: Sribeiro , pgsql-sql@postgresql.org Subject: Re: Re: ERROR while creating new user - could not open relation mapping file global/pg_filenode.map In-reply-to: <20151124221035.GJ4073@alvherre.pgsql> References: <1448307482990-5874842.post@n5.nabble.com> <565378B4.5080801@aklaver.com> <1448311158958-5874860.post@n5.nabble.com> <1448386072130-5874934.post@n5.nabble.com> <32161.1448402563@sss.pgh.pa.us> <20151124221035.GJ4073@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 24 Nov 2015 19:10:35 -0300" Date: Tue, 24 Nov 2015 17:24:17 -0500 Message-ID: <366.1448403857@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org Alvaro Herrera writes: > Tom Lane wrote: >> You might be able to fix this by doing a fresh initdb (targeting some >> other location for the data directory, of course, but being careful >> to use the exact same Postgres version) and then copying the >> global/pg_filenode.map file out of that data directory and into your >> broken one. This would only work if you've never done a VACUUM FULL on >> any of the shared catalogs in the existing data directory, so it's far >> from guaranteed to work; but it's worth a try. > It's relatively easy to identify the files corresponding to each > catalog, even when they have been mapped; just pg_filedump the files > until you find ones that match the expected number of attributes, and > disambiguate based on which attributes have HEAP_VARWIDTH and such. > Then you just need to cp the right files to the default names using the > default map created in the freshly initdb'd cluster. Yeah, but that's getting past the level of what I'd expect an average user to be able to do. If the data is valuable enough to justify that level of effort, it'd be wise to hire a data recovery expert (such as yourself ;-)). I'm suspicious that the "accidental damage" extended to more than just global/pg_filenode.map. If it was really something more like "find -name '*.map' | xargs rm", it would definitely be into professional recovery territory, IMO. regards, tom lane -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql