From: | Tony Caduto <tony_caduto(at)amsoftwaredesign(dot)com> |
---|---|
To: | Karen Hill <karen_hill22(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Stored Procedure performance / elegance question |
Date: | 2006-09-12 16:40:25 |
Message-ID: | 4506E2F9.8040707@amsoftwaredesign.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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
From | Date | Subject | |
---|---|---|---|
Next Message | Don Parris | 2006-09-12 16:47:03 | Question About Aggregate Functions |
Previous Message | Martijn van Oosterhout | 2006-09-12 16:29:48 | Re: Bytea to Text problems |