Re: Triggers After INSERT

Поиск
Список
Период
Сортировка
От Gregory Wood
Тема Re: Triggers After INSERT
Дата
Msg-id 4058F323.5080502@ewebengine.com
обсуждение исходный текст
Ответ на Triggers After INSERT  ("Stephane Tessier" <stephane.tessier@abovesecurity.com>)
Ответы Re: Triggers After INSERT  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-general
Stephane Tessier wrote:
> Hi,
>
> I have a problem with triggers in postgresql 7.3.4 and PHP... I have a lot
> of insert to do from a table x to table y ( average of 10000 rows each
> time). I use a trigger AFTER INSERT but it seems that PHP wait for the
> result of the trigger to ending the script... Is it possible to avoid
> waiting for a return value and let the trigger do the job...????

It's not so much the trigger that's holding up your script, it's the
fact that the query is executed synchronously. Although I've never done
it before, you can send the query asynchronously using pg_send_query().
I'm not sure that the script will complete while there are still queries
pending (otherwise in the case of persistent connections, I can see this
depleting the pool of connections), but it's worth a shot. For more
information:

http://www.php.net/manual/en/function.pg-send-query.php

Keep in mind however that you won't receive a success or failure when
you do this.

Greg

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

Предыдущее
От: Mark Harrison
Дата:
Сообщение: any sql for doing radix conversion?
Следующее
От: "Siew Hui, Wong"
Дата:
Сообщение: Re: LWP::Simple in Postgresql 7.3.4 - SOLUTION