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 1ow44X-0002tU-LR for pgsql-general@arkaria.postgresql.org; Fri, 18 Nov 2022 16:18:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ow44W-0005cu-Bx for pgsql-general@arkaria.postgresql.org; Fri, 18 Nov 2022 16:18:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ow44U-0005cd-PT for pgsql-general@lists.postgresql.org; Fri, 18 Nov 2022 16:18:32 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ow44M-0008FI-DY for pgsql-general@postgresql.org; Fri, 18 Nov 2022 16:18:30 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 86E965C040B; Fri, 18 Nov 2022 11:18:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 18 Nov 2022 11:18:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1668788299; x= 1668874699; bh=5dNLuRbaUmIDM1nNUhMZ/lh1UCQyEzd7WpGJmuX+jwI=; b=o v4vOBJoOlxPFHSnmmvnIUcEXH65Kt24FAlHaNTiaIZGzYoA6kDrysA3ttrh09tcW C7IVqWAb40G1tBT6WyrF0Ckn+xWFy0bDZ6+XOTZDV2DNUulWsmQX+YUq3gIikmQP bmNtxZh5/B+H31vDRlHjolTbfXAgybeNvBDasvHuWjPZIqx8BDzIwVtxUPiw6dAH J96CIUO5CLhRpux6VANtBSDFT0QJOLjaIIpoNfUe0BIfnS3cisHH3nh3u13iG0sd 8qMIREymB+UMjGYDejBhxs5ge9lkZOSxkFLHTo9Jbmw9Ra1SZnB3xpmECSjbiIg0 5s1x2aXEmBoRZqSseefHg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1668788299; x=1668874699; bh=5 dNLuRbaUmIDM1nNUhMZ/lh1UCQyEzd7WpGJmuX+jwI=; b=VxqbZ/mnejBKtdT0e 4jWKiaj11OFu/JDZr6bwOwXFzS9ifaZP+EvNXdk/jEyAN2Ej8MpdGSVqf0txphqj AO/zx/fg40KWdHZ2KVAFkDSacdXcMugrh0Btw7ey90ED7mKzEUKuzk/CuwpM8uBA ltSEmhF8ospoPtl6kxAjJkIqBBY5dZlH9IBcqps9bizDy+ANIY9ir8ADeJWBunmc PiJJqe5TqfvgPQlA/b1MrELILrRY7oxCGAj6PTokKHAupLzfoVPV2Qs/eqdOItMI Mj6mgu6nbZ+qeZ16JAt28WgxUWBfAgQ0as/v67080wVKFewmtCFVwTF6K/BjgpRp 1Rrzg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrhedtgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepleekgeejhfekteehfeduveetheeivdduheekudelteef vdffueehtddvgedtfeefnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgr nhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 18 Nov 2022 11:18:19 -0500 (EST) Message-ID: Date: Fri, 18 Nov 2022 08:18:18 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: copy databases from two differend backups to one cluster To: Joseph Kennedy , pgsql-general@postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/18/22 04:33, Joseph Kennedy wrote: > I would like to copy databases from two different pg_basebackup backups > to one lab environment database cluster on another server. Is it possible ? > > It's a good idea to do it in that way. > > Databases has your oid in pg_basebackup we can find it id in base > directory for example: > Is it a good or  very bad idea ? Bad idea. For why see: https://www.postgresql.org/docs/current/storage-file-layout.html and https://www.postgresql.org/docs/current/storage-page-layout.html There is more to a cluster then what is found in a given databases directory. You can't, at the file(binary) level, just rip a database out of one cluster and graft it into another. If you want to do this then the options are: 1) As Ron suggested dump/restore. 2) Setting up logical replication. > > > -- Adrian Klaver adrian.klaver@aklaver.com