Re: [PATCH] pg_sleep(interval)

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: [PATCH] pg_sleep(interval)
Дата
Msg-id 1381955648.63633.YahooMailNeo@web162903.mail.bf1.yahoo.com
обсуждение исходный текст
Ответ на Re: [PATCH] pg_sleep(interval)  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: [PATCH] pg_sleep(interval)  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> wrote:

> Anyone who actually wants this in their environment can
> add the overloaded function in their environment with a one-line SQL
> function: pg_sleep(interval) as proposed here is just
> pg_sleep(extract(epoch from now() + $1) - extract(epoch from now())).

You're making it sound way harder than it is.  Why not just:

create function my_sleep(delay interval)
  returns void language sql
  as 'select pg_sleep(extract(epoch from $1))';

... or,  of course, named to match the existing function.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Auto-tuning work_mem and maintenance_work_mem
Следующее
От: Andres Freund
Дата:
Сообщение: Re: removing old ports and architectures