Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBhfr-0003sB-SN for pgsql-general@arkaria.postgresql.org; Wed, 03 Apr 2019 15:19:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hBhfq-0002di-Ds for pgsql-general@arkaria.postgresql.org; Wed, 03 Apr 2019 15:19:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBhfq-0002db-0C for pgsql-general@lists.postgresql.org; Wed, 03 Apr 2019 15:19:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hBhfn-00040T-1A for pgsql-general@lists.postgresql.org; Wed, 03 Apr 2019 15:19:32 +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 x33FJTtu015465; Wed, 3 Apr 2019 11:19:29 -0400 From: Tom Lane To: Alvaro Herrera cc: Steven Lembark , "pgsql-general@lists.postgresql.org" Subject: Re: Move vs. copy table between databases that share a tablespace? In-reply-to: <20190403151246.GA10916@alvherre.pgsql> References: <20190403151246.GA10916@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Wed, 03 Apr 2019 12:12:46 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15463.1554304769.1@sss.pgh.pa.us> Date: Wed, 03 Apr 2019 11:19:29 -0400 Message-ID: <15464.1554304769@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2019-Apr-03, Tom Lane wrote: >> Actually, thinking about that a bit harder: there's one aspect of >> what pg_upgrade does that's really hard to control from userspace, >> and that's forcing tables to have the same OIDs as before. In this >> context, that means you're probably out of luck if the table has a >> TOAST table, unless the TOAST table is empty. There wouldn't be >> any good way to keep TOAST pointers valid across the move. > Hmm, couldn't you use the binary-upgrade support functions just prior to > creating the table in the target database? Yeah, in theory you could do that, if the OID isn't already in use for a table. But that just added several more steps and more ways to shoot yourself in the foot. I'm starting to think this wouldn't really be worth the risk. regards, tom lane