I have my_table with two text columns: my_query, which contains various DML queries in text form; and and my_explanation, which is entirely populated with nulls.
I'd like to do something like:
UPDATE my_table SET my_explanation = execute explain analyze my_table.my_query
So that the my_explanation column on each row is updated to contain the textual output of the explain analyze of the query contained in its my_query column.
I tried making a function with cursors but it didn't work. I'm still learning pgplsql. Any ideas?