Re: Is it possible to store the output of EXPLAIN into a table - Mailing list pgsql-general

From Tom Lane
Subject Re: Is it possible to store the output of EXPLAIN into a table
Date
Msg-id 15374.1555948921@sss.pgh.pa.us
Whole thread Raw
In response to Is it possible to store the output of EXPLAIN into a table  (Souvik Bhattacherjee <kivuosb@gmail.com>)
Responses Re: Is it possible to store the output of EXPLAIN into a table  (Souvik Bhattacherjee <kivuosb@gmail.com>)
List pgsql-general
Souvik Bhattacherjee <kivuosb@gmail.com> writes:
> I was just wondering if it is possible to store the output of EXPLAIN into
> a table.

EXPLAIN won't do that directly, but you could make a plpgsql function
along the lines of

      for t in execute explain ...
         return next t;

(too lazy to check the exact details here, but I believe you can find
related examples in our regression tests) and then store the function's
result into a table.

            regards, tom lane



pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Is it possible to store the output of EXPLAIN into a table
Next
From: Adrian Klaver
Date:
Subject: Re: Resetting identity columns