an INSERT target list during rule rewriting. Per report from John Supplee.
#include "optimizer/tlist.h"
#include "parser/parsetree.h"
#include "parser/parse_clause.h"
+#include "parser/parse_coerce.h"
#include "rewrite/rewriteManip.h"
#include "utils/lsyscache.h"
else
{
/* Otherwise replace unmatched var with a null */
- return (Node *) makeNullConst(var->vartype);
+ /* need coerce_type_constraints in case of NOT NULL domain constraint */
+ return coerce_type_constraints((Node *) makeNullConst(var->vartype),
+ var->vartype,
+ COERCE_IMPLICIT_CAST);
}
}
else