Re: Prepared statement already exists

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: Prepared statement already exists
Дата
Msg-id 20081120133018.GA3810@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: Prepared statement already exists  ("Merlin Moncure" <mmoncure@gmail.com>)
Ответы Re: Prepared statement already exists  (WireSpot <wirespot@gmail.com>)
Список pgsql-general
Merlin Moncure escribió:
> On Wed, Nov 19, 2008 at 2:42 PM, WireSpot <wirespot@gmail.com> wrote:

> > 3) Reading a list of all the currently defined prepared statements to
> > see if the one I want is already prepared. I'm hoping some "magic"
> > SELECT in pg's internal tables may do the trick. But I also worry
> > about introducing overhead this way.
>
> pg_prepared_statements (on recent versions of postgresql)
>
> also, watch out for race conditions.

What race conditions?  Prepared statements are per-connection.

Perhaps the application could keep a hash of statements prepared so far,
to avoid having to query pg_prepared_statements all the time.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: Frank Bax
Дата:
Сообщение: Re: [SQL] date range query help
Следующее
От: WireSpot
Дата:
Сообщение: Re: Prepared statement already exists