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 1nOWN6-00034n-U5 for pgsql-general@arkaria.postgresql.org; Mon, 28 Feb 2022 03:06:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nOWN4-0003lL-S2 for pgsql-general@arkaria.postgresql.org; Mon, 28 Feb 2022 03:06:46 +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 1nOWN4-0003ku-Gx for pgsql-general@lists.postgresql.org; Mon, 28 Feb 2022 03:06:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nOWN0-0007go-1L for pgsql-general@lists.postgresql.org; Mon, 28 Feb 2022 03:06:46 +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 21S36eWX2424742; Sun, 27 Feb 2022 22:06:40 -0500 From: Tom Lane To: Lucas cc: pgsql-general@lists.postgresql.org Subject: Re: PG 14 Create Rule ERROR - RETURNING list has too few entries In-reply-to: <2F0E9E62-6F42-4AB2-B183-C22BDF0598A0@sud0.nz> References: <171636E4-4BAC-4440-A7FC-533C94719021@sud0.nz> <2F0E9E62-6F42-4AB2-B183-C22BDF0598A0@sud0.nz> Comments: In-reply-to Lucas message dated "Mon, 28 Feb 2022 15:57:42 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2424740.1646017600.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 27 Feb 2022 22:06:40 -0500 Message-ID: <2424741.1646017600@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Lucas writes: > Ooops, I forgot to paste the CREATE RULE statement as an example: > The idea of these roles is a superimposed version of post-QBO ja_notes t= hat exposes an inferred (from ja_jobs) "clientid" after the redundant colu= mn was removed from public.ja_notes. It also localizes timestamps in accor= dance to the legacy modification dates, and truncates start_time to whole = seconds only > CREATE RULE r_di_ja_notes AS > ON DELETE TO doctrine.ja_notes DO INSTEAD DELETE FROM ja_notes r_110= 3088 WHERE (r_1103088.id =3D old.id) > RETURNING r_1103088.id, = > r_1103088.mobiuserid, = > [etc] The RETURNING list has to match the column list of the rule's target table or view (here, doctrine.ja_notes). Maybe you added some columns to that since this last worked? regards, tom lane