We forgot that rule in the case of creating the target tables for the materializing views commands, which led to surprising and wrong behavior. Fix #721, and add a new test case while at it.