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 1pDz7t-0004oJ-TR for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Jan 2023 02:40:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pDz7s-0002Hd-NX for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Jan 2023 02:40:04 +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 1pDz7s-0002HS-Er for pgsql-hackers@lists.postgresql.org; Sat, 07 Jan 2023 02:40:04 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pDz7p-0003eS-UQ for pgsql-hackers@lists.postgresql.org; Sat, 07 Jan 2023 02:40:04 +0000 Received: from bruce by momjian.us with local (Exim 4.94.2) (envelope-from ) id 1pDz7n-00F81d-M2; Fri, 06 Jan 2023 21:39:59 -0500 Date: Fri, 6 Jan 2023 21:39:59 -0500 From: Bruce Momjian To: Hari krishna Maddileti Cc: PostgreSQL Hackers Subject: Re: Support for dumping extended statistics Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jan 5, 2023 at 06:29:03PM +0000, Hari krishna Maddileti wrote: > Hi Team, > In order to restore dumped extended statistics (stxdndistinct, > stxddependencies, stxdmcv) we need to provide input functions to parse > pg_distinct/pg_dependency/pg_mcv_list strings. > > Today we get the ERROR "cannot accept a value of type pg_ndistinct/ > pg_dependencies/pg_mcv_list" when we try to do an insert of any type. > > Approch tried: > > - Using yacc grammar file (statistics_gram.y) to parse the input string to its > internal format for the types pg_distinct and pg_dependencies > > - We are just calling byteain() for serialized input text of type pg_mcv_list. > > Currently the changes are working locally, I would like to push the commit > changes to upstream if there any usecase for postgres. Would like to know if > there any interest from postgres side. There is certainly interest in allowing the optimizer statistics to be dumped and reloaded. This could be used by pg_restore and pg_upgrade. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Embrace your flaws. They make you human, rather than perfect, which you will never be.