Hi all,

I want to add a column, i.e. an additional TargetEntry, in an executor node 
named Foo that is placed on top of the usually created plan. This node Foo will 
calculate the column which is then used to sort the relation subsequently. If 
desired, the column added by Foo is finally removed by a projection node, and 
might thus be a junk col.

(Projection 
that removes bar, 
if desired)
 |
 |
Sort,
sorts by bar
 |
 |
Foo,
adds column bar
 |
 |
Usual
Plan
 |
 |
...


How do I add an additional TargetEntry in my Foo node? Unfortunately, it does 
not suffice to simply append the TargetEntry after copying the child's 
targetlist in make_foo(Plan *). (I tested it and seems that some client side 
code complains about 'advertised_#cols != actual_#cols')

How do I compute/evaluate the column? I just see ExecProject which  evaluates 
the _whole_ targetlist with ExecTargetList. But I would like to retrieve a 
tuple from the child node, evaluate my expression, wrap it into a TargetEntry 
and append it to the tuple. Iterate.

Regards,
Peter

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to