]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Use if exists on dropping all postgresql tables
authorKern Sibbald <kern@sibbald.com>
Wed, 15 Jan 2020 20:09:31 +0000 (21:09 +0100)
committerKern Sibbald <kern@sibbald.com>
Wed, 15 Jan 2020 20:11:04 +0000 (21:11 +0100)
bacula/src/cats/drop_postgresql_tables.in

index 8e4f5e5d93468dafef8319a8532945af2060ae8b..495d054ea67fb9b18691482f1e9643d7b63951d5 100644 (file)
@@ -9,33 +9,33 @@ bindir=@POSTGRESQL_BINDIR@
 db_name=@db_name@
 
 $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;
-drop table fileset;
-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 if exists MAC;
-drop table log;
-drop table Location;
-drop table locationlog;
-drop table PathVisibility;
-drop table PathHierarchy;
-drop table RestoreObject;
-drop table Snapshot;
+drop table if exists unsavedfiles;
+drop table if exists basefiles;
+drop table if exists jobmedia;
+drop table if exists file;
+drop table if exists job;
+drop table if exists jobhisto;
+drop table if exists media;
+drop table if exists client;
+drop table if exists pool;
+drop table if exists fileset;
+drop table if exists path;
+drop table if exists filename;
+drop table if exists counters;
+drop table if exists version;
+drop table if exists CDImages;
+drop table if exists Device;
+drop table if exists Storage;
+drop table if exists MediaType;
+drop table if exists Status;
+drop table if exists mac;
+drop table if exists log;
+drop table if exists Location;
+drop table if exists locationlog;
+drop table if exists PathVisibility;
+drop table if exists PathHierarchy;
+drop table if exists RestoreObject;
+drop table if exists Snapshot;
 END-OF-DATA
 pstat=$?
 if test $pstat = 0;