Re: [HACKERS] Useless code in ExecInitModifyTable

2017-09-04 Thread Ryan Murphy
> FWIW, I find that good ol' patch is much more reliable about applying > patches that didn't come from git itself. In this case > > Thanks, I knew I was missing something! Ryan

Re: [HACKERS] Useless code in ExecInitModifyTable

2017-09-04 Thread Tom Lane
Ryan Murphy writes: > I downloaded the latest patch "clean-nodeModifyTable-v2.patch" > and tried applying it to HEAD using "git apply ". > The only response from git was "fatal: unrecognized input". FWIW, I find that good ol' patch is much more reliable about applying patches that didn't come fr

Re: [HACKERS] Useless code in ExecInitModifyTable

2017-09-04 Thread Ryan Murphy
Hello! I downloaded the latest patch "clean-nodeModifyTable-v2.patch" and tried applying it to HEAD using "git apply ". The only response from git was "fatal: unrecognized input". I tried this with git 2.5.4 stable that comes native on my mac, and git 2.12 built from source. In both cases I got

Re: [HACKERS] Useless code in ExecInitModifyTable

2017-09-04 Thread Etsuro Fujita
On 2017/06/21 17:57, Amit Langote wrote: On 2017/06/21 16:59, Etsuro Fujita wrote: Commit d3cc37f1d801a6b5cad9bf179274a8d767f1ee50 added this to ExecInitModifyTable: + /* The root table RT index is at the head of the partitioned_rels list */ + if (node->partitioned_rels) + { + Index

Re: [HACKERS] Useless code in ExecInitModifyTable

2017-06-21 Thread Amit Langote
On 2017/06/22 11:25, Etsuro Fujita wrote: > On 2017/06/21 23:52, Robert Haas wrote: > >> You're right that there is a comment missing from the function header, >> but it's not too hard to figure out what it should be. Just consult >> the definition of ModifyTable itself: >> >> /* RT inde

Re: [HACKERS] Useless code in ExecInitModifyTable

2017-06-21 Thread Etsuro Fujita
On 2017/06/21 23:52, Robert Haas wrote: You're right that there is a comment missing from the function header, but it's not too hard to figure out what it should be. Just consult the definition of ModifyTable itself: /* RT indexes of non-leaf tables in a partition tree */ Lis

Re: [HACKERS] Useless code in ExecInitModifyTable

2017-06-21 Thread Tom Lane
Robert Haas writes: > It appears to me that create_modifytable_path() has a partitioned_rels > argument and it looks like inheritance_planner not only passes it but > guarantees that it's non-empty when the target is a partitioned table. Oh, somehow I missed the call in inheritance_planner. Righ

Re: [HACKERS] Useless code in ExecInitModifyTable

2017-06-21 Thread Robert Haas
On Wed, Jun 21, 2017 at 10:33 AM, Tom Lane wrote: > Amit Langote writes: >> On 2017/06/21 16:59, Etsuro Fujita wrote: >>> but I noticed that that function doesn't use the relation descriptor at >>> all. Since partitioned_rels is given in case of an UPDATE/DELETE on a >>> partitioned table, the r

Re: [HACKERS] Useless code in ExecInitModifyTable

2017-06-21 Thread Tom Lane
Amit Langote writes: > On 2017/06/21 16:59, Etsuro Fujita wrote: >> but I noticed that that function doesn't use the relation descriptor at >> all. Since partitioned_rels is given in case of an UPDATE/DELETE on a >> partitioned table, the relation is opened in that case, but the relation >> descr

Re: [HACKERS] Useless code in ExecInitModifyTable

2017-06-21 Thread Amit Langote
Fujita-san, On 2017/06/21 16:59, Etsuro Fujita wrote: > Commit d3cc37f1d801a6b5cad9bf179274a8d767f1ee50 added this to > ExecInitModifyTable: > > + /* The root table RT index is at the head of the partitioned_rels list */ > + if (node->partitioned_rels) > + { > + Index root_rti; > +

[HACKERS] Useless code in ExecInitModifyTable

2017-06-21 Thread Etsuro Fujita
Commit d3cc37f1d801a6b5cad9bf179274a8d767f1ee50 added this to ExecInitModifyTable: + /* The root table RT index is at the head of the partitioned_rels list */ + if (node->partitioned_rels) + { + Index root_rti; + Oid root_oid; + + root_rti = linitial_int(node->par