Re: Generating a query that never returns

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Generating a query that never returns
Date: 2011-09-19 15:09:05
Message-ID: e4a4d667fba802f68c3b8bbf8a52527e@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)turnstep(dot)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-----

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2011-09-19 15:10:51 Re: CUDA Sorting
Previous Message Andrew Dunstan 2011-09-19 15:07:30 Re: A little pg_dump patch