Re: Prepared statements in PGSQL functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Prepared statements in PGSQL functions
Дата
Msg-id 23768.1150295728@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Prepared statements in PGSQL functions  ("Milen Kulev" <makulev@gmx.net>)
Ответы Re: Prepared statements in PGSQL functions
Список pgsql-sql
"Milen Kulev" <makulev@gmx.net> writes:
> I want to use prepared statement in a function.

Why?  You seem not to be aware that plpgsql implicitly prepares
statements behind the scenes.

>         prepare  mystmt( int, int, varchar)    as insert into part values ($1,$2,$3);
>         execute  mystmt(v_id1, v_id2, v_filler );
>         deallocate mystmt;

If that worked it would be *exactly* the same as just doing
    insert into part values (v_id1, v_id2, v_filler);

except for being slower due to re-preparing each time through the
function.  So don't waste your time trying to outsmart the language.
        regards, tom lane


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

Предыдущее
От: "Aaron Bono"
Дата:
Сообщение: Re: how to replace 0xe28093 char with another one?
Следующее
От: "Milen Kulev"
Дата:
Сообщение: Re: Prepared statements in PGSQL functions