pgsql: Add some errdetail to checkRuleResultList().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add some errdetail to checkRuleResultList().
Date: 2014-07-02 18:21:13
Message-ID: E1X2P9d-00010E-BA@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add some errdetail to checkRuleResultList().

This function wasn't originally thought to be really user-facing,
because converting a table to a view isn't something we expect people
to do manually. So not all that much effort was spent on the error
messages; in particular, while the code will complain that you got
the column types wrong it won't say exactly what they are. But since
we repurposed the code to also check compatibility of rule RETURNING
lists, it's definitely user-facing. It now seems worthwhile to add
errdetail messages showing exactly what the conflict is when there's
a mismatch of column names or types. This is prompted by bug #10836
from Matthias Raffelsieper, which might have been forestalled if the
error message had reported the wrong column type as being "record".

Per Alvaro's advice, back-patch to branches before 9.4, but resist
the temptation to rephrase any existing strings there. Adding new
strings is not really a translation degradation; anyway having the
info presented in English is better than not having it at all.

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/110d293a68708b7c0fa3460fd38a028bc3324101

Modified Files
--------------
src/backend/rewrite/rewriteDefine.c | 33 ++++++++++++++++++++++++++++-----
1 file changed, 28 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2014-07-02 19:08:26 pgsql: Rename logical decoding's pg_llog directory to pg_logical.
Previous Message Tom Lane 2014-07-02 17:59:18 Re: pgsql: Add some errdetail to checkRuleResultList().