pgsql: Improve error message for rejecting RETURNING clauses with dropp

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve error message for rejecting RETURNING clauses with dropp
Date: 2016-03-01 00:12:45
Message-ID: E1aaXvh-0003YW-V2@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Improve error message for rejecting RETURNING clauses with dropped columns.

This error message was written with only ON SELECT rules in mind, but since
then we also made RETURNING-clause targetlists go through the same logic.
This means that you got a rather off-topic error message if you tried to
add a rule with RETURNING to a table having dropped columns. Ideally we'd
just support that, but some preliminary investigation says that it might be
a significant amount of work. Seeing that Nicklas Avén's complaint is the
first one we've gotten about this in the ten years or so that the code's
been like that, I'm unwilling to put much time into it. Instead, improve
the error report by issuing a different message for RETURNING cases, and
revise the associated comment based on this investigation.

Discussion: 1456176604(dot)17219(dot)9(dot)camel(at)jordogskog(dot)no

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/dcba544dd5f76974ea273cd689ab9ff41a22af1e

Modified Files
--------------
src/backend/rewrite/rewriteDefine.c | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-03-01 00:29:25 pgsql: Suppress scary-looking log messages from async-notify isolation
Previous Message Alvaro Herrera 2016-02-29 21:19:11 pgsql: Minor tweaks for new src/test/recovery