Re: Sleep functions

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>, mike(at)fuhr(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Sleep functions
Date: 2005-08-22 16:30:43
Message-ID: 4309FDB3.2070900@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark wrote:

>"Dave Page" <dpage(at)vale-housing(dot)co(dot)uk> writes:
>
>
>
>>Sure it's trivial in various languages, even in trusted PL/Tcl:
>>
>>CREATE FUNCTION sleep(integer) RETURNS void AS $$
>>after [expr $1 * 1000]
>>$$ LANGUAGE pltcl STRICT;
>>
>>
>
>Do any of the trusted languages count branches and abort after some large
>number to prevent trusted code from causing long delays?
>
>
>

I don't believe so. What arbitrary limit would you like to set?

The thing that bothers me slightly about doing this in PLs is that it
might well monkey with the signal handling which could cause very hard
to debug problems. But maybe that's just paranoia - I haven't looked at
it closely.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2005-08-22 16:42:36 Re: enable_constraint_exclusion GUC name
Previous Message Tom Lane 2005-08-22 16:30:13 Re: [HACKERS] PostgreSQL 8.0.3 and Ipv6