Re: Stored Procedure performance / elegance question - Mailing list pgsql-general

From Tony Caduto
Subject Re: Stored Procedure performance / elegance question
Date
Msg-id 4506E2F9.8040707@amsoftwaredesign.com
Whole thread Raw
In response to Stored Procedure performance / elegance question  ("Karen Hill" <karen_hill22@yahoo.com>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Bytea to Text problems
Next
From: Tom Lane
Date:
Subject: Re: Superuser lost access to particular database