A bozo's blog
#!/usr/bin/perl my $cmd = "psql -Xq --set ON_ERROR_STOP=on --dbname crmmbqt <<'EOS' "; $cmd .= <<'END'; do $$ begin raise notice '%', pg_is_in_recovery(); end $$ END $cmd .= 'EOS '; print `$cmd`;