]> granicus.if.org Git - postgresql/commit
Add some errdetail to checkRuleResultList().
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 2 Jul 2014 16:31:27 +0000 (12:31 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 2 Jul 2014 16:31:27 +0000 (12:31 -0400)
commitcec3be05f624bc32599c2a056ec1b47bec917510
treea451943f61f27b11658cc62f4fac7cb2a89ee8e1
parent5520006b5bbaa36e6734a8ccf960bb870f4a4fec
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".

Back-patch to 9.4, but not into older branches where the set of
translatable error strings is supposed to be stable.
src/backend/rewrite/rewriteDefine.c