On Tue, Jun 14, 2016 at 10:29 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I think you want to be looking at the way that CREATE VIEW accomplishes
> the same task. See DefineView and DefineVirtualRelation. It might be
> worth refactoring those a bit to allow code sharing.
Ah, right! I forgot that views already solve this problem in its way,
and that's definitely something that we should do.
[code lookup]
OK I see now how to wrap that. I'll come up with something that can be
back-patched and think about the refactoring carefully.
--
Michael