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 1lEdQJ-0000D5-D3 for pgsql-admin@arkaria.postgresql.org; Tue, 23 Feb 2021 19:32:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lEdQH-00027v-CV for pgsql-admin@arkaria.postgresql.org; Tue, 23 Feb 2021 19:32:41 +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 1lEdQH-00026P-4q for pgsql-admin@lists.postgresql.org; Tue, 23 Feb 2021 19:32:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEdQD-00075y-Lk for pgsql-admin@postgresql.org; Tue, 23 Feb 2021 19:32:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 11NJWUKe3891954; Tue, 23 Feb 2021 14:32:30 -0500 From: Tom Lane To: Holger Jakobs cc: "[PGSQL-ADMIN-LIST]" Subject: Re: Export and import of statistics data In-reply-to: References: Comments: In-reply-to Holger Jakobs message dated "Tue, 23 Feb 2021 19:53:17 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3891952.1614108750.1@sss.pgh.pa.us> Date: Tue, 23 Feb 2021 14:32:30 -0500 Message-ID: <3891953.1614108750@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Holger Jakobs writes: > Is there a way of exporting statistics data from a database cluster > containing a lot of rows and import them into a similar structured, but > small database cluster. Not at present, AFAIK. There have been discussions of creating a way to do that, and I know of at least one non-public tool that does it, but nobody's pushed things to the point of having code the community would accept. The key stumbling block is inventing a dump representation that would have realistic prospects of still being importable if/when we change the contents of pg_statistic. Certainly there are a lot of applications where cross-version compatibility isn't a requirement; but I don't think the community would take code that isn't usable by pg_upgrade, and for that you need an upgradable design. regards, tom lane