Re: sleep function

Поиск
Список
Период
Сортировка
От John DeSoi
Тема Re: sleep function
Дата
Msg-id 46D44C5D-EBCF-11D8-A1CD-000A95B03262@icx.net
обсуждение исходный текст
Ответ на Re: sleep function  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: sleep function  (Greg Stark <gsstark@mit.edu>)
Список pgsql-sql
On Aug 10, 2004, at 10:57 AM, Bruce Momjian wrote:

> I can't think of one, no.  I think you will have to use one of the
> server-side languages and call a sleep in there.


This is no good in the real world since it pounds the CPU, but it 
worked well enough for my testing purposes.

Best,

John DeSoi, Ph.D.




create or replace function sleep (integer) returns time as 'declare    seconds alias for $1;    later time;    thetime
time;begin   thetime := timeofday()::timestamp;    later := thetime + (seconds::text || '' seconds'')::interval;
loop       if thetime >= later then            exit;        else            thetime := timeofday()::timestamp;
endif;    end loop;
 
    return later;end;
' language plpgsql;



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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: reply to setting
Следующее
От: Lars Erik Thorsplass
Дата:
Сообщение: Fwd: Inserts with incomplete rows... NOT NULL constraints