Re: plpgsql variable substitution problem ...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: plpgsql variable substitution problem ...
Дата
Msg-id 12699.959537744@sss.pgh.pa.us
обсуждение исходный текст
Ответ на plpgsql variable substitution problem ...  (Greg Wickham <greg@geelong.com>)
Список pgsql-sql
Greg Wickham <greg@geelong.com> writes:
> 000528.19:45:45.725  [9553] query: SELECT  max( $1 ) FROM  $2

There is no facility in plpgsql for run-time specification of a table
name, and probably never will be for the general case.  It's possible
that it could be made to work for selection of a particular table among
the inheritance children of a specified table, but not for any arbitrary
table, unless we want to give up preparsing and preplanning of plpgsql
queries.

pltcl does everything on-the-fly at runtime, so you could do this in
that language, I think (and accept the resulting speed penalty).

A more interesting question is whether you shouldn't redesign your
database schema so that you don't need to do this...
        regards, tom lane


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

Предыдущее
От: Greg Wickham
Дата:
Сообщение: plpgsql variable substitution problem ...
Следующее
От: Carolyn Wong
Дата:
Сообщение: date format