Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fpc6w-00013P-Oj for pgsql-general@arkaria.postgresql.org; Tue, 14 Aug 2018 16:23:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fpc6u-0003uL-UX for pgsql-general@arkaria.postgresql.org; Tue, 14 Aug 2018 16:23:56 +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.89) (envelope-from ) id 1fpc6u-0003tz-Mc for pgsql-general@lists.postgresql.org; Tue, 14 Aug 2018 16:23:56 +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.89) (envelope-from ) id 1fpc6s-0000wy-5A for pgsql-general@lists.postgresql.org; Tue, 14 Aug 2018 16:23:56 +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 w7EGNqE3002291; Tue, 14 Aug 2018 12:23:52 -0400 From: Tom Lane To: Jack Cushman cc: pgsql-general@lists.postgresql.org Subject: Re: Duplicating data folder without tablespace, for read access In-reply-to: References: Comments: In-reply-to Jack Cushman message dated "Tue, 14 Aug 2018 11:57:38 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2289.1534263832.1@sss.pgh.pa.us> Date: Tue, 14 Aug 2018 12:23:52 -0400 Message-ID: <2290.1534263832@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Jack Cushman writes: > Now here's the situation where I want to do what Christophe said not to do: > :) > I have a large database of text, with a 600GB table and a 100GB table > connected by a join table. They both see occasional updates throughout the > week. Once a week I want to "cut a release," meaning I will clone just the > 100GB table and copy it to a "release" server for read-only web access. > My procedure would be: > - keep the 600GB table on a separate tablespace > - cleanly stop postgres on both servers > - copy the data folder to the release server > - delete pg_tblspc/* on the release server > - start postgres on both servers > In local testing this seems to work -- the release server works fine, and I > only get an error message if I try to access the missing tables, which is > expected. But are there reasons this is going to bite me if I try it in > production? Sooner or later, autovacuum is going to try to touch the missing table. Maybe you can limp along with autovac failing in the background, especially if this is a throwaway copy of the DB with little or no write activity. But I'm not sure how well that will work. Probably, the worst-case scenario would be for the database to shut down because it thinks it's in XID wraparound trouble. But it's hard to see how you get to that without lots of write traffic, so maybe you can get away with this. regards, tom lane