Search Postgresql Archives

Re: Stored Procedure performance / elegance question

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

 



Karen Hill wrote:
x-no-archive:yes

Hello.

I have a stored procedure which returns a setof record.  The function
takes a few arguments, and if a couple of specific input values are
null, it is required that the stored procedure perform different
actions.

I know that the planner does not store the plan when EXECUTE is used in
a function, but the function looks better when the sql is created
dynamically.

Karen,
My particular opinion on this is to only use execute if  you need it.
If you don't need it don't use it.
A example where you would need execute is if you wanted to create a new user from inside a function with a passed in username. Another example where you would need EXECUTE is if you are working with temp tables in a function.

Later,

--

Tony Caduto
AM Software Design
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql
Your best bet for Postgresql Administration


[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