Remove check for NOT NULLable column from ORCA translation of INSERT values.
When creating an ORCA plan for "INSERT ... (<col list>) VALUES (<values>)" statement, the ORCA translator performed NULL checks for any columns not listed in the column list. Nothing wrong with that per se, but we needed to keep the error messages in sync, or we'd get regression test failures caused by different messages. To simplify that, remove the check from ORCA translator, and rely on the execution time check. We bumped into this while working on the 9.3 merge, because 9.3 added DETAIL to the error message in executor: postgres=# create table notnulls (a text NOT NULL, b text NOT NULL); CREATE TABLE postgres=# insert into notnulls (a) values ('x'); ERROR: null value in column "b" violates not-null constraint postgres=# insert into notnulls (a,b) values ('x', NULL); ERROR: null value in column "b" violates not-null constraint (seg2 127.0.0.1:40002 pid=26547) DETAIL: Failing row contains (x, null). Doing this now will avoid that inconsistency in the merge. One little difference with this is that EXPLAIN on an insert like above now works, and you only get the error when you try to execute it. Before, with ORCA, even EXPLAIN would throw the error.
Showing
此差异已折叠。
想要评论请 注册 或 登录