Closed MichaelDBA closed 2 years ago
I cant figure out how to capture the STDOUT in variables when invoked from a procedure using variables:
v_parm = 'VACUUM (ANALYZE, VERBOSE) public.film'; SELECT * FROM pg_background_result(pg_background_launch(v_parm)) as (v_results TEXT) INTO v_results2; RAISE INFO 'results=% results2=%', v_results, v_results2; --> INFO: results=<NULL> results2=VACUUM
When I run it, the results are displayed on the screen (STDOUT), but not captured in variables above.
The result of a VACUUM command is VACUUM, which you can capture in a variable. However, INFO is a process message (not a result). Therefore cannot be captured in a procedure variable.
VACUUM
INFO
Thanks
I cant figure out how to capture the STDOUT in variables when invoked from a procedure using variables:
When I run it, the results are displayed on the screen (STDOUT), but not captured in variables above.