summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/appendinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/util/appendinfo.c')
-rw-r--r--src/backend/optimizer/util/appendinfo.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/backend/optimizer/util/appendinfo.c b/src/backend/optimizer/util/appendinfo.c
index 6ba4eba224a..49897226371 100644
--- a/src/backend/optimizer/util/appendinfo.c
+++ b/src/backend/optimizer/util/appendinfo.c
@@ -160,11 +160,15 @@ make_inh_translation_list(Relation oldrelation, Relation newrelation,
/* Found it, check type and collation match */
if (atttypid != att->atttypid || atttypmod != att->atttypmod)
- elog(ERROR, "attribute \"%s\" of relation \"%s\" does not match parent's type",
- attname, RelationGetRelationName(newrelation));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_COLUMN_DEFINITION),
+ errmsg("attribute \"%s\" of relation \"%s\" does not match parent's type",
+ attname, RelationGetRelationName(newrelation))));
if (attcollation != att->attcollation)
- elog(ERROR, "attribute \"%s\" of relation \"%s\" does not match parent's collation",
- attname, RelationGetRelationName(newrelation));
+ ereport(ERROR,
+ (errcode(ERRCODE_INVALID_COLUMN_DEFINITION),
+ errmsg("attribute \"%s\" of relation \"%s\" does not match parent's collation",
+ attname, RelationGetRelationName(newrelation))));
vars = lappend(vars, makeVar(newvarno,
(AttrNumber) (new_attno + 1),