David Rowley <dgrowle...@gmail.com> writes: > I'd been looking at the code in ExecInitModifyTable() that's the same > as what you pasted thinking you meant that. I think for the check for > partitioned tables in ExecModifyTable() then it's likely just dead > code. It seems to be causing a bit of confusion though, so might be > worth doing something about. Copied in Tom to see what he thinks as > it's one of his.
Yeah, it's dead code in the sense that we should never reach these if-blocks with a partitioned table. I believe the reason I made it like that is that the logic is concerned with which style of row identity applies to a particular relkind, and in the planner we treat partitioned tables as requiring this style of row identity, so that the right things happen for their children. So the answer is basically "for consistency with add_row_identity_columns". Maybe we could instead have add_row_identity_columns do nothing for a partitioned table, but I'm unconvinced of that. regards, tom lane