Re: Generating a query that never returns - Mailing list pgsql-hackers

From Greg Sabino Mullane
Subject Re: Generating a query that never returns
Date
Msg-id e4a4d667fba802f68c3b8bbf8a52527e@biglumber.com
Whole thread Raw
In response to Generating a query that never returns  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


> I have a need to test timeouts in JDBC, is there a query that is
> guaranteed not to return ?

Not *never*, but close enough:

select pg_sleep(999999999999999999999999999999999999999999999999);

Or if you want to be strict:

CREATE FUNCTION noreturn() RETURNS VOID LANGUAGE plperl AS $$ while (1) { select (undef,undef,undef,0.1) } $$;

- -- 
Greg Sabino Mullane greg@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201109191104
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAk53WvYACgkQvJuQZxSWSsiItACg+BXmjoR9ecJWuU/AOka+/CBX
rAcAoOQi0MhHk0cWp2aFc87yvZOyY5T1
=wnlW
-----END PGP SIGNATURE-----




pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: A little pg_dump patch
Next
From: Thom Brown
Date:
Subject: Re: CUDA Sorting