Re: Sleep functions - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Sleep functions
Date
Msg-id 4309FDB3.2070900@dunslane.net
Whole thread Raw
In response to Re: Sleep functions  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers

Greg Stark wrote:

>"Dave Page" <dpage@vale-housing.co.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


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: enable_constraint_exclusion GUC name
Next
From: Hannu Krosing
Date:
Subject: Re: Missing CONCURRENT VACUUM (Was: Release notes for