Re: Return results of join with polymorphically-defined table in pl/pgsql - Mailing list pgsql-general

From David G. Johnston
Subject Re: Return results of join with polymorphically-defined table in pl/pgsql
Date
Msg-id CAKFQuwZYxwiNA0XDHqJUx700eCQ9CnQhj5DZcSis=edBkF0GGA@mail.gmail.com
Whole thread Raw
In response to Return results of join with polymorphically-defined table in pl/pgsql  (Peter Devoy <peter@3xe.co.uk>)
List pgsql-general
On Sunday, July 24, 2016, Peter Devoy <peter@3xe.co.uk> wrote:
However, I would like to create a function which returns the resultset
of an INNER JOIN with table1 being polymorphic and table2 being a
result set of column types which do not change.  Is this possible?

Providing a concrete example might help.  But, SQL requires that, at runtime, all columns and types in the final query be defined at the time of its execution.  Even those coming from a function declared returning "record".  You can get dynamic SQL to accomplish pretty much anything as long as you keep that rule in mind.

David J.

pgsql-general by date:

Previous
From: Peter Devoy
Date:
Subject: Return results of join with polymorphically-defined table in pl/pgsql
Next
From: John R Pierce
Date:
Subject: Re: Return results of join with polymorphically-defined table in pl/pgsql