Re: Queries w/ "computed" table names? (eval in Pg?)

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Queries w/ "computed" table names? (eval in Pg?)
Дата
Msg-id 1203724244.7878.44.camel@dogma.ljc.laika.com
обсуждение исходный текст
Ответ на Queries w/ "computed" table names? (eval in Pg?)  ("Kynn Jones" <kynnjo@gmail.com>)
Список pgsql-general
On Fri, 2008-02-22 at 18:40 -0500, Kynn Jones wrote:
> Hi.  Suppose I have a database that contains a "meta table" that holds
> the names of other the tables in the database, keyed by human-readable
> but longish strings.  I would like to write queries that first
> "compute" the names of some tables (i.e. by looking them up in "meta
> table"), and after that they execute subqueries using these computed
> table names.  The following invalid SQL illustrates the kind of

You can create a PL/pgSQL function and use "EXECUTE".

Depending on how you want to use it, you may need to make it a set-
returning function (a.k.a. table function).

Regards,
    Jeff Davis


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

Предыдущее
От: "Kynn Jones"
Дата:
Сообщение: Queries w/ "computed" table names? (eval in Pg?)
Следующее
От: Steve Atkins
Дата:
Сообщение: Re: Queries w/ "computed" table names? (eval in Pg?)