Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vx8RV-00H8pI-0u for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Mar 2026 18:56:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vx8RS-002ViA-1I for pgsql-hackers@arkaria.postgresql.org; Mon, 02 Mar 2026 18:56:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vx8RS-002Vi2-0Q for pgsql-hackers@lists.postgresql.org; Mon, 02 Mar 2026 18:56:30 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vx8RQ-000000003me-0avJ for pgsql-hackers@lists.postgresql.org; Mon, 02 Mar 2026 18:56:30 +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 622IuM2a863994; Mon, 2 Mar 2026 13:56:23 -0500 From: Tom Lane To: =?utf-8?Q?=C3=81lvaro?= Herrera cc: Florin Irion , Haritabh Gupta , pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement In-reply-to: <202603021736.6nix27wwg6e6@alvherre.pgsql> References: <202603021736.6nix27wwg6e6@alvherre.pgsql> Comments: In-reply-to =?utf-8?Q?=C3=81lvaro?= Herrera message dated "Mon, 02 Mar 2026 18:49:59 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <863992.1772477782.1@sss.pgh.pa.us> Date: Mon, 02 Mar 2026 13:56:22 -0500 Message-ID: <863993.1772477782@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?utf-8?Q?=C3=81lvaro?= Herrera writes: > I think it would be more helpful to have a test module that > 1. installs an event trigger on ddl_command_end for CREATE for > object being created > 2. runs all the tests in parallel_schedule > 3. do [... something ...] with the event trigger to generate the DDL > using the new functions, and compare with the object created > originally. (There's a lot of handwaving here. Maybe pg_dump both > and compare?) While I agree that automating this might be helpful, please please please do not create yet another execution of the core regression tests. There is far too much stuff in there that is not DDL and will only be useless cycles for this purpose. I wonder if it'd be practical to extract just the DDL commands from the core scripts, and then run just those through a process like you suggest? I agree that the "handwaving" part is trickier than it looks. If memory serves, we've had bugs-of-omission where somebody forgot to update pg_dump for some new feature, and it wasn't obvious because comparing pg_dump output against pg_dump output didn't show that the relevant object property wasn't copied correctly. In this context, forgetting to update both pg_dump and the DDL-dumping function would mask both omissions. Maybe that's unlikely, but ... > Another possibility is to use the pg_dump/t/002_pg_dump.pl database > instead of the stock regression one, which is perhaps richer in object > type diversity. I think that test script also suffers from the out-of-sight, out-of-mind problem. Not to mention that you need a lot of study to figure out how to modify it at all. I certainly avoid doing so. regards, tom lane