Re: Prepared statements versus stored procedures

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Prepared statements versus stored procedures
Дата
Msg-id CAKFQuwZXD91VWGASxwotrOi_ftdbrC+kV-jvORupfE_PdkCxCQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Prepared statements versus stored procedures  (Francisco Olarte <folarte@peoplecall.com>)
Список pgsql-general
On Sun, Nov 19, 2023 at 11:09 AM Francisco Olarte <folarte@peoplecall.com> 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.

В списке pgsql-general по дате отправления:

Предыдущее
От: Simon Connah
Дата:
Сообщение: Re: Prepared statements versus stored procedures
Следующее
От: "PGUser2020"
Дата:
Сообщение: How can I return a UTF8 string from a hex representation in a latin9 database?