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 1n7fFI-0008AP-5h for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Jan 2022 15:09:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n7fFG-0003aX-Oh for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Jan 2022 15:09:02 +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 1n7fFG-0003aG-GH for pgsql-bugs@lists.postgresql.org; Wed, 12 Jan 2022 15:09:02 +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 1n7fFD-0002Ke-2e for pgsql-bugs@lists.postgresql.org; Wed, 12 Jan 2022 15:09:00 +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 20CF8jbS2996294; Wed, 12 Jan 2022 10:08:45 -0500 From: Tom Lane To: Timur Khanjanov cc: pgsql-bugs@lists.postgresql.org Subject: Re: wrong output in dump of rules with old values of row type columns In-reply-to: References: Comments: In-reply-to Timur Khanjanov message dated "Wed, 12 Jan 2022 12:04:14 +0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2996292.1642000125.1@sss.pgh.pa.us> Date: Wed, 12 Jan 2022 10:08:45 -0500 Message-ID: <2996293.1642000125@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Timur Khanjanov writes: > create table test(a int); > create table test_log(old test); > create rule del as on delete to test do insert into test_log values(old); As a workaround you could write it as create rule del as on delete to test do insert into test_log select old; which will reverse-list as ON DELETE TO test DO INSERT INTO test_log (old) SELECT old.*::test AS old Looks like we need to apply the same hack in VALUES lists. regards, tom lane