Re: function for testing that causes the backend to terminate

From: Joe Conway <mail(at)joeconway(dot)com>
To: Dave Cramer <davecramer(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: function for testing that causes the backend to terminate
Date: 2021-04-29 20:16:37
Message-ID: 0711ce9f-72ed-6544-15ef-c56faaaae11d@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

--
Crunchy Data - http://crunchydata.com
PostgreSQL Support for Secure Enterprises
Consulting, Training, & Open Source Development

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2021-04-30 00:24:39 Re: Replication slot stats misgivings
Previous Message Richard Yen 2021-04-29 19:39:57 Re: Patch to allow pg_filedump to support reading of pg_filenode.map