On 2019-12-16 19:53, Peter Eisentraut wrote:
> SQL:2016 has a feature called polymorphic table functions (PTF) that
> addresses this. The full PTF feature is much larger, so I just carved
> out this particular piece of functionality. Here is a link to some
> related information:
> https://modern-sql.com/blog/2018-11/whats-new-in-oracle-database-18c#ptf
>
> The idea is that you attach a helper function to the main function. The
> helper function is called at parse time with the constant arguments of
> the main function call and can compute a result row description (a
> TupleDesc in our case).
Here is an updated patch for the record, since the previous patch had
accumulated some significant merge conflicts.
I will reply to the discussions elsewhere in the thread.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services