Exploring a Postgres query plan

from blog Notes on software development, | ↗ original
I learned this week that you can intercept and redirect Postgres query execution. You can hook into the execution layer so you're given a query plan and you get to decide what to do with it. What rows to return, if any, and where they come from. That's very interesting. So I started writing code to explore execution hooks. However, I got stuck...