Kind of a newbie-ish question I guess. I could not find a good answer in the faq or the Perl DBI book.

I'm writing a bit of database maintenance and need to save the output from the postgresql vacuum command, but it apparently writes to standard error rather than return the info.

All I get is the -1 return value and the verbose output goes to STDERR. Is there any way I can redirect that and pick it up with a method invocation?

Currently I'm doing this in order to capture the info:
open(STDERR, "> vacuumOutput.txt");
my $retVal = $dbh->do("VACUUM VERBOSE ANALYSE $tableName");

I don't like reopening stderr, is there some other way to do this?

Thanks for any help,
Anders

Reply via email to