From: Jan Wieck <jan@wi3ck.info>
To: Tiffany Thang <tiffanythang@gmail.com>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Profiling a function call
Date: Sun, 21 May 2023 07:27:47 -0400
Message-ID: <a4f86d7c-79c4-c70f-ead9-112243ec56e2@wi3ck.info> (raw)
In-Reply-To: <CAB_W-NNUBTh4t8TPzb05jb+3d0s4ijPqh8h1odqeY=gAqXjwxA@mail.gmail.com>
References: <CAB_W-NNUBTh4t8TPzb05jb+3d0s4ijPqh8h1odqeY=gAqXjwxA@mail.gmail.com>
On 5/20/23 00:36, Tiffany Thang wrote:
> Hi,
> I have a function that has been executing for a long time and not
> returning any results. Wait event=NULL so it seems like it is still
> executing and not waiting on any specific resources. Is there a way to
> profile the function call to get an idea of what it is currently
> executing within the function? All I could find in pg_stat_activity is
> the function is running. I want to know what query/transaction within
> the function is running. Is there a way to obtain that information?
This may give you some idea. I haven't touched or used it in many years,
but it might get you started:
https://github.com/wieck/plbacktrace
Best Regards, Jan
>
> PostgreSQL 15.2 on Linux.
>
> Thanks.
>
> Tiff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: jan@wi3ck.info, tiffanythang@gmail.com
Subject: Re: Profiling a function call
In-Reply-To: <a4f86d7c-79c4-c70f-ead9-112243ec56e2@wi3ck.info>
References: <CAB_W-NNUBTh4t8TPzb05jb+3d0s4ijPqh8h1odqeY=gAqXjwxA@mail.gmail.com> <a4f86d7c-79c4-c70f-ead9-112243ec56e2@wi3ck.info>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox