From: | Peter Devoy <peter(at)3xe(dot)co(dot)uk> |
---|---|
To: | "Psql_General (E-mail)" <pgsql-general(at)postgresql(dot)org> |
Subject: | Return results of join with polymorphically-defined table in pl/pgsql |
Date: | 2016-07-24 23:45:47 |
Message-ID: | CABoFc_hKAjQrQd2ZJy+nmqgr8e3GufkHg6Q_U3T-45+4+ForMQ@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Hi list
The example at the bottom of this
(http://stackoverflow.com/questions/11740256/11751557#11751557) answer
shows how the anyelement polymorphic type can be used to have a
function accept -- and return rows from -- an arbitrary table decided
by the user at runtime.
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?
I have seen a solution using CREATE TEMP VIEW but I understand this
could race if the function was called multiple times in the same
session. Obviously there would be way to minimize that risk but
things would start to get messy.
Any ideas would be much appreciated.
Kind regards
Peter Devoy
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2016-07-25 00:48:32 | Re: Return results of join with polymorphically-defined table in pl/pgsql |
Previous Message | Tom Lane | 2016-07-24 15:16:12 | Re: A simple extension immitating pg_notify |