#!/bin/sh PGHOME=/tmp/pgsql PGDATA=/tmp/pgsql/data PATH=${PGHOME}/bin:${PATH} export PGHOME PGDATA PATH createdb testdb psql -e testdb< /tmp/dump_before_drop # remove the table file. rm -rf $tablefile rm -rf ${PGDATA}/*.pid rm -rf ${PGDATA}/pg_log/* pg_ctl -w -D ${PGDATA} start -o "-p 5433" cat ${PGDATA}/pg_log/* psql -e testdb< /tmp/dump_after_recovery