| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера