Re: Tuple-routing for certain partitioned tables not working as expected
Amit Langote <langote_amit_f8@lab.ntt.co.jp>
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Etsuro Fujita <fujita.etsuro@lab.ntt.co.jp>, pgsql-hackers@postgresql.org
Date: 2017-08-07T06:33:57Z
Lists: pgsql-hackers
On 2017/08/07 15:22, Etsuro Fujita wrote: > On 2017/08/07 13:11, Amit Langote wrote:> The patch looks good too. > Although, looking at the following hunk: >> >> + Assert(partrel->rd_rel->relkind == RELKIND_RELATION || >> + partrel->rd_rel->relkind == RELKIND_FOREIGN_TABLE); >> + >> /* >> * Verify result relation is a valid target for the current >> operation. >> */ >> ! if (partrel->rd_rel->relkind == RELKIND_RELATION) >> ! CheckValidResultRel(partrel, CMD_INSERT); >> >> makes me now wonder if we need the CheckValidResultRel check at all. The >> only check currently in place for RELKIND_RELATION is >> CheckCmdReplicaIdentity(), which is a noop (returns true) for inserts >> anyway. > > Good point! I left the verification for a plain table because that is > harmless but as you mentioned, that is nothing but an overhead. So, here > is a new version which removes the verification at all from > ExecSetupPartitionTupleRouting. The updated patch looks good to me, thanks. Regards, Amit
Commits
-
Even if some partitions are foreign, allow tuple routing.
- 08cb36417aa2 10.0 landed
- 9d71323daca4 11.0 landed