Re: dynamic table naming in function
От | Matthew Peter |
---|---|
Тема | Re: dynamic table naming in function |
Дата | |
Msg-id | 20051029192221.13431.qmail@web35214.mail.mud.yahoo.com обсуждение исходный текст |
Ответ на | Re: dynamic table naming in function (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-general |
Thanks for pointing me in the right direction. I read about EXECUTE in the docs now. > 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. I'm not sure what you mean... Is there a more suitable LANGUAGE declaration you would recommend? If possible, I would also like to return results from SELECT statments from the function but EXECUTE doesn't return any results. I'm not tied to plpgsql, but would like to make a couple dynamic functions with whatever way is simplest or best tool for the job. --- Tom Lane <tgl@sss.pgh.pa.us> wrote: > 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 > __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
В списке pgsql-general по дате отправления: