From: Tom Lane <tgl@sss.pgh.pa.us>
To: Lucas <root@sud0.nz>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PG 14 Create Rule ERROR - RETURNING list has too few entries
Date: Sun, 27 Feb 2022 22:06:40 -0500
Message-ID: <2424741.1646017600@sss.pgh.pa.us> (raw)
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>
Lucas <root@sud0.nz> 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 that exposes an inferred (from ja_jobs) "clientid" after the redundant column was removed from public.ja_notes. It also localizes timestamps in accordance 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_1103088 WHERE (r_1103088.id = 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, root@sud0.nz
Subject: Re: PG 14 Create Rule ERROR - RETURNING list has too few entries
In-Reply-To: <2424741.1646017600@sss.pgh.pa.us>
References: <171636E4-4BAC-4440-A7FC-533C94719021@sud0.nz> <2F0E9E62-6F42-4AB2-B183-C22BDF0598A0@sud0.nz> <2424741.1646017600@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox