Search Postgresql Archives

Re: Prepared statements versus stored procedures

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

 



On Sun, Nov 19, 2023 at 11:09 AM Francisco Olarte <folarte@xxxxxxxxxxxxxx> wrote: 
IIRC it does it once per
transaction, but it should be in the docs.

There is no external caching for executing a CALL; the runtime executes the procedure afresh each time.  If it were any different that would have to be documented.

You do not
turn a stored procedure into a statement, you turn CALLING the stored
procedure into a prepared statement,

Which is not possible.  CALL is not a valid target for PREPARE; the valid ones are documented.

The fact that store procedures do not return result sets - and are procedures - and prepared statements are not procedures and can return result sets makes any kind of direct comparison pretty meaningless in practice.  They do different things and solve different problems.  Know what the problem you are trying to solve is and which of the two are plausible options will make itself clear.

David J.


[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 Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux