X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 10FE114B2866 for ; Wed, 11 Aug 2004 16:48:50 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07816-06 for ; Wed, 11 Aug 2004 19:48:41 +0000 (GMT) Received: from gull.mail.pas.earthlink.net (gull.mail.pas.earthlink.net [207.217.120.84]) by svr1.postgresql.org (Postfix) with ESMTP id D742414B2821 for ; Wed, 11 Aug 2004 16:48:39 -0300 (ADT) Received: from user-1120lp8.dsl.mindspring.com ([66.32.87.40] helo=[192.168.1.10]) by gull.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 1Buz5U-0003Ab-00 for pgsql-sql@postgresql.org; Wed, 11 Aug 2004 12:48:41 -0700 Mime-Version: 1.0 (Apple Message framework v613) In-Reply-To: <200408101457.i7AEvvc15187@candle.pha.pa.us> References: <200408101457.i7AEvvc15187@candle.pha.pa.us> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <46D44C5D-EBCF-11D8-A1CD-000A95B03262@icx.net> Content-Transfer-Encoding: 7bit From: John DeSoi Subject: Re: sleep function Date: Wed, 11 Aug 2004 15:47:28 -0400 To: PostgreSQL X-Mailer: Apple Mail (2.613) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200408/93 X-Sequence-Number: 18590 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; end if; end loop; return later; end; ' language plpgsql;