Re: RFC: Logging plan of the running query

Étienne BERSAC <etienne.bersac@dalibo.com>

From: Étienne BERSAC <etienne.bersac@dalibo.com>
To: torikoshia <torikoshia@oss.nttdata.com>, Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, jtc331@gmail.com, pgsql-hackers@lists.postgresql.org
Date: 2023-10-24T07:12:46Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. ecpg: Catch zero-length Unicode identifiers correctly

  2. Improve warning message in pg_signal_backend()

  3. Add assert to ensure that page locks don't participate in deadlock cycle.

> Hi,
> 
> Yeah, and when we have a situation where we want to run
> pg_log_query_plan(), we can run it in any environment as long as it
> is bundled with the core.

Is it possible to get the plan of a backend programmatically without
access to the logs?

Something like pg_get_query_plan(pid, format) which output would be the
same as EXPLAIN.

Regards,
Étienne BERSAC
Dalibo