| От | Tom Lane |
|---|---|
| Тема | Re: dynamic table naming in function |
| Дата | |
| Msg-id | 12012.1130609786@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | dynamic table naming in function (Matthew Peter <survivedsushi@yahoo.com>) |
| Ответы |
Re: dynamic table naming in function
|
| Список | pgsql-general |
Matthew Peter <survivedsushi@yahoo.com> writes:
> Out of curiosity, I was wondering if it is possible to
> use dynamic table names in a function?
In plpgsql, you can do this by building dynamic query strings and
EXECUTE'ing them. Most of the other PLs don't cache query plans
at all, and so all queries are effectively EXECUTE'd and there's
no issue.
You'll want to read up on quote_literal and quote_ident to help
you in building correct query strings.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера