db_user=${db_user:-@db_user@}
sql -u${db_user} ${db_name} $* <<END-OF-DATA
-DROP TABLE filename;
-DROP TABLE path;
-DROP TABLE file;
-DROP TABLE Job;
-DROP TABLE JobHisto;
-DROP TABLE Location;
-DROP TABLE fileset;
-DROP TABLE jobmedia;
-DROP TABLE media;
-DROP TABLE MediaType;
-DROP TABLE Storage;
-DROP TABLE Device;
-DROP TABLE pool;
-DROP TABLE client;
-DROP TABLE Log;
-DROP TABLE LocationLog;
-DROP TABLE counters;
-DROP TABLE basefiles;
-DROP TABLE unsavedfiles;
-DROP TABLE CDImages ;
-DROP TABLE PathHierarchy;
-DROP TABLE PathVisibility;
-DROP TABLE version;
-DROP TABLE Status;
-DROP SEQUENCE filename_seq;
-DROP SEQUENCE path_seq;
-DROP SEQUENCE file_seq;
-DROP SEQUENCE Job_seq;
-DROP SEQUENCE JobHisto_seq;
-DROP SEQUENCE Location_seq;
-DROP SEQUENCE fileset_seq;
-DROP SEQUENCE jobmedia_seq;
-DROP SEQUENCE media_seq;
-DROP SEQUENCE MediaType_seq;
-DROP SEQUENCE Storage_seq;
-DROP SEQUENCE Device_seq;
-DROP SEQUENCE pool_seq;
-DROP SEQUENCE client_seq;
-DROP SEQUENCE Log_seq;
-DROP SEQUENCE LocationLog_seq;
-DROP SEQUENCE basefiles_seq;
-\g
+DROP TABLE filename\g
+DROP TABLE path\g
+DROP TABLE file\g
+DROP TABLE Job\g
+DROP TABLE JobHisto\g
+DROP TABLE Location\g
+DROP TABLE fileset\g
+DROP TABLE jobmedia\g
+DROP TABLE media\g
+DROP TABLE MediaType\g
+DROP TABLE Storage\g
+DROP TABLE Device\g
+DROP TABLE pool\g
+DROP TABLE client\g
+DROP TABLE Log\g
+DROP TABLE LocationLog\g
+DROP TABLE counters\g
+DROP TABLE basefiles\g
+DROP TABLE unsavedfiles\g
+DROP TABLE CDImages \g
+DROP TABLE PathHierarchy\g
+DROP TABLE PathVisibility\g
+DROP TABLE version\g
+DROP TABLE Status\g
+DROP SEQUENCE filename_seq\g
+DROP SEQUENCE path_seq\g
+DROP SEQUENCE file_seq\g
+DROP SEQUENCE Job_seq\g
+DROP SEQUENCE JobHisto_seq\g
+DROP SEQUENCE Location_seq\g
+DROP SEQUENCE fileset_seq\g
+DROP SEQUENCE jobmedia_seq\g
+DROP SEQUENCE media_seq\g
+DROP SEQUENCE MediaType_seq\g
+DROP SEQUENCE Storage_seq\g
+DROP SEQUENCE Device_seq\g
+DROP SEQUENCE pool_seq\g
+DROP SEQUENCE client_seq\g
+DROP SEQUENCE Log_seq\g
+DROP SEQUENCE LocationLog_seq\g
+DROP SEQUENCE basefiles_seq\g
END-OF-DATA
pstat=$?
if test $pstat = 0;