Re: function for testing that causes the backend to terminate - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: function for testing that causes the backend to terminate
Date
Msg-id d72c21cb-5ed9-7170-2741-a6b1f1113d0c@dunslane.net
Whole thread Raw
In response to Re: function for testing that causes the backend to terminate  (Joe Conway <mail@joeconway.com>)
List pgsql-hackers
On 4/29/21 4:16 PM, Joe Conway wrote:
> On 4/29/21 6:56 AM, Dave Cramer wrote:
>> For testing unusual situations I'd like to be able to cause a backend
>> to terminate due to something like a segfault. Do we currently have
>> this in testing ?
>
> If you can run SQL as a superuser from that backend, try:
>
> COPY (SELECT pg_backend_pid())
>  TO PROGRAM 'xargs kill -SIGSEGV';
>
> HTH,
>
> Joe
>


or a plperlu function that does 'kill 11, $$;' should do it.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Enhanced error message to include hint messages for redundant options error
Next
From: Mark Dilger
Date:
Subject: Re: Granting control of SUSET gucs to non-superusers