Re: sleep function

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: sleep function
Дата
Msg-id 87hdqu5x5q.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: sleep function  (John DeSoi <jd@icx.net>)
Ответы Re: sleep function  (John DeSoi <jd@icx.net>)
Re: sleep function  (Sanjay Singh <sanjjay@igcar.ernet.in>)
Список pgsql-sql
John DeSoi <jd@icx.net> writes:

> 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.

You went the long way around. I think what he meant was something as simple
as:

bash-2.05b$ /usr/lib/postgresql/bin/createlang -U postgres plperlu test

bash-2.05b$ psql -d test -U postgres
Welcome to psql 7.4.2, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms      \h for help with SQL commands      \? for help on internal slash commands
    \g or terminate with semicolon to execute query      \q to quit
 

test=# create or replace function sleep(integer) returns integer as 'return sleep(shift)' language plperlu;
CREATE FUNCTION

test=# \timing
Timing is on.

test=# select sleep(10) ;sleep 
-------   10
(1 row)

Time: 10002.493 ms


-- 
greg



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

Предыдущее
От: Worik
Дата:
Сообщение: pg_dump/pg_restore question
Следующее
От: Greg Stark
Дата:
Сообщение: Re: only last records in subgroups