Re: Inserting a timed delay in a pl/pgsql procedure

Поиск
Список
Период
Сортировка
От John DeSoi
Тема Re: Inserting a timed delay in a pl/pgsql procedure
Дата
Msg-id C9CA00EE-2ACB-4A86-AD84-EEA4E3198322@pgedit.com
обсуждение исходный текст
Ответ на Inserting a timed delay in a pl/pgsql procedure  ("Benjamin Krajmalnik" <kraj@illumen.com>)
Ответы Re: Inserting a timed delay in a pl/pgsql procedure  (Michael Fuhr <mike@fuhr.org>)
Список pgsql-admin
On Aug 18, 2006, at 3:26 PM, Benjamin Krajmalnik wrote:

> However, it appears that current_timestamp is not being recalculated.
> Any ideas? While normally we want the stored procedures to run as
> quickly as possible, this is a case where I need to insert a delay.
> I guess an option would be to place a counter and loop through it, but
> it does not allow me the control I relly need.

current_timestamp returns the same value for the scope of the
transaction (or function call). Search the archives for "sleep" for
previous discussions of this issue. You can use timeofday to get a
changing time value, but any looping you do in plpgsql will eat a lot
of CPU cycles. The only other solution I recall was to use a
different pl language like perl which has a proper sleep function.


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Restoring database question..
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Inserting a timed delay in a pl/pgsql procedure