]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/drop_postgresql_tables.in
Improve the "update stats" sql command
[bacula/bacula] / bacula / src / cats / drop_postgresql_tables.in
index f7cf26dda89872c3df94cf2baf637cad1ab14108..9f4e312e1c9628724674726fcba0be099905498e 100644 (file)
@@ -3,14 +3,15 @@
 # shell script to delete Bacula tables for PostgreSQL
 
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-if $bindir/psql $* -f - <<END-OF-DATA
-\c bacula
+$bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 drop table unsavedfiles;
 drop table basefiles;
 drop table jobmedia;
 drop table file;
 drop table job;
+drop table jobhisto;
 drop table media;
 drop table client;
 drop table pool;
@@ -19,10 +20,24 @@ drop table path;
 drop table filename;
 drop table counters;
 drop table version;
+drop table CDImages;
+drop table Device;
+drop table Storage;
+drop table MediaType;
+drop table Status;
+drop table MAC;
+drop table log;
+drop table Location;
+drop table locationlog;
+drop table PathVisibility;
+drop table PathHierarchy;
+drop table RestoreObject;
 END-OF-DATA
+pstat=$?
+if test $pstat = 0; 
 then
    echo "Deletion of Bacula PostgreSQL tables succeeded."
 else
    echo "Deletion of Bacula PostgreSQL tables failed."
 fi
-exit 0
+exit $pstat