Return results of join with polymorphically-defined table in pl/pgsql

Поиск
Список
Период
Сортировка
От Peter Devoy
Тема Return results of join with polymorphically-defined table in pl/pgsql
Дата
Msg-id CABoFc_hKAjQrQd2ZJy+nmqgr8e3GufkHg6Q_U3T-45+4+ForMQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Return results of join with polymorphically-defined table in pl/pgsql  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: Return results of join with polymorphically-defined table in pl/pgsql  (John R Pierce <pierce@hogranch.com>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: A simple extension immitating pg_notify
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Return results of join with polymorphically-defined table in pl/pgsql