Search Postgresql Archives

Re: dynamic table naming in function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx> wrote:

> Matthew Peter <survivedsushi@xxxxxxxxx> 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

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux