Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6yv4-0004FE-VW for pgsql-general@arkaria.postgresql.org; Tue, 02 Feb 2021 16:52:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l6yv3-0005fe-Su for pgsql-general@arkaria.postgresql.org; Tue, 02 Feb 2021 16:52:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6yv3-0005ch-Kq for pgsql-general@lists.postgresql.org; Tue, 02 Feb 2021 16:52:49 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6yv0-0000nC-LO for pgsql-general@lists.postgresql.org; Tue, 02 Feb 2021 16:52:48 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 338F95C02DE; Tue, 2 Feb 2021 11:52:45 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 02 Feb 2021 11:52:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=6 YPpGkxGCkhBQOaRsWFfKq3RkBOmw94O98C1YEvJlP8=; b=LDVuyyNvkL5Y/mnW3 x3/MvqjMUsT/8Z4grOE6w+kW0EHQj9fHd5C8JRgOiHngEV+mFLiSQ09i1OlPvo0h uXYjnE9Gp0WbtI3rMfbUpna/TkBeC1cjZjJ3ELOUUplfolHrZjG7rBA1ctggDZal e8+QsJIL/39smWh6xSocfj4qyK7gLxaG5DsmyQvFwx+siM4nTjYqUeNmAIDIQqsh DfGp3joB+My7rcGfqz32XHOx74NzLrrDVIfvxIPoywn2oLbbE8G2YdDSee7VZO79 HFR2xUPP29bg/ASOQqRdy6/e3cdolb0IGm5F1110FvuQR6cY+qsM/3Lxm9I/LlqE rRjCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=6YPpGkxGCkhBQOaRsWFfKq3RkBOmw94O98C1YEvJl P8=; b=VqWn2pV9pl66JAuG5mZunDkM/Xji1PUiqqVYXEtBzNp3nQPOmE4mp5pBd +f9HbbXqSjol9Qxq7G15U30DhSDCd9lxFZKdxUVGMZ31drQyG2M8jZYJ/x2kC3F3 OsI+WwTm2VwPT+9mgXzRfvjyXo3sc6e3x3V1jMMr7jNoIb3+AtRIn5tt3YxsP7j5 X4deW95WyoYGSMkBpvPgLllhu8I8rGHn6LzLwmj3vQHbu62uRCdMuZLliLrA1X04 yRMEVatF02qsY4pcVzLyHEYhJ4Iry18lCJ4vUuopAh/h+kLf5lJXDX3Ibcp7ll83 3lZS+kj0NSXuT/6v+kK0Cj7qeAZtA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrgedtgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepveetjedtieekteefhffhhfetledvkeffvedugeejueek hffgvdeileeitdekvefhnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenuc fkphepleejrdduudefrddvudejrddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrd gtohhm X-ME-Proxy: Received: from [192.168.1.4] (97-113-217-27.tukw.qwest.net [97.113.217.27]) by mail.messagingengine.com (Postfix) with ESMTPA id 8AA28240057; Tue, 2 Feb 2021 11:52:44 -0500 (EST) Subject: Re: pg_dumpall and tablespaces To: Joao Miguel Ferreira , pgsql-general References: From: Adrian Klaver Message-ID: Date: Tue, 2 Feb 2021 08:52:43 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2/2/21 8:43 AM, Joao Miguel Ferreira wrote: > Hello all, > > I have a dump file obtained from pg_dumpall on a MAC computer. I need to > load in onto my Linux laptop running postgres. > > My scenario is software development. I'm trying to load the dump onto my > Pg installation running on Linux (and later possibly on Linux over > Docker) in order to perform my sw development against a fresh copy of > the data. > > I got 2 problems concerning tablespaces: > a) during the restore step I get lots of errors about the necessity to > have root permissions to re-create the tablespaces and > b) the tablespaces paths on the dump file are bound to the MAC > filesystem (/Users/..../pg/....). I would need to re-write that path to > my home folder or '/var/lib/....' > > Obviously I'm a bit confused on how to do this. > > pg_dumpall is very powerfull and simple, specially when using the > "--create" option that does all the work for me. > > I would appreciate any directions on how to restore that dump Do you want to maintain tablespaces on the dev machine? If not from here: https://www.postgresql.org/docs/12/app-pg-dumpall.html --no-tablespaces Do not output commands to create tablespaces nor select tablespaces for objects. With this option, all objects will be created in whichever tablespace is the default during restore. This would have to be done when the pg_dumpall is run. > > thank you > Joao > -- Adrian Klaver adrian.klaver@aklaver.com