summaryrefslogtreecommitdiff
path: root/sysutils/bacula15-server/files/patch-src_cats_update__postgresql__tables.in
blob: 6a0e5629a6aa0bacad59b6f3a4c59fbe578c7396 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
--- src/cats/update_postgresql_tables.in.orig	2024-09-16 19:41:23 UTC
+++ src/cats/update_postgresql_tables.in
@@ -186,7 +186,7 @@ if [ "$DBVERSION" -eq 15 -o "$DBVERSION" -eq 16 ]; the
     echo " doesn't have write permission on the current directory,"
     echo " or if the system doesn't have enough space to store a"
     echo " compressed export of the File table"
-    psql --set ON_ERROR_STOP=1 -d ${db_name} $* -c "set work_mem='$WORKMEM';"'set enable_mergejoin to off ; set enable_hashjoin to off; copy (SELECT FileId, FileIndex, JobId, PathId, Filename.Name, DeltaSeq, MarkId, LStat, Md5 FROM File JOIN Filename USING (FilenameId)) TO STDOUT' | $COMP -1 -c > file1017.data
+    psql -q --set ON_ERROR_STOP=1 -d ${db_name} $* -c "set work_mem='$WORKMEM';"'set enable_mergejoin to off ; set enable_hashjoin to off; copy (SELECT FileId, FileIndex, JobId, PathId, Filename.Name, DeltaSeq, MarkId, LStat, Md5 FROM File JOIN Filename USING (FilenameId)) TO STDOUT' | $COMP -1 -c > file1017.data
     
     if [ $? -ne 0 ]; then
 	echo "Error while dumping file table to $PWD/file1017.data"
@@ -219,12 +219,12 @@ EOF
 	exit 1
     fi
 
-    echo "Loading the File table from $PWD/file.$$.data..."
+    echo "Loading the File table from $PWD/file1017.data..."
     # we do everything in the same commit to avoid creating WALs on this operation
     cat file1017.data | $COMP -d | psql --set ON_ERROR_STOP=1 -d ${db_name} $* -c "BEGIN; TRUNCATE File; COPY File FROM STDIN; set maintenance_work_mem='2000MB'; CREATE INDEX file_jpfid_idx on File (JobId, PathId, Filename text_pattern_ops); ALTER TABLE ONLY File ADD CONSTRAINT file_pkey PRIMARY KEY (FileId); COMMIT;"
     
     if [ $? -ne 0 ]; then
-	echo "Inserting File data from file.$$.data failed."
+	echo "Inserting File data from file1017.data failed."
 	exit 1
     fi
 
@@ -285,7 +285,7 @@ if [ "$STOP1015" = "" -a "$DBVERSION" -eq 1015 ]; then
     echo " doesn't have write permission on the current directory,"
     echo " or if the system doesn't have enough space to store a"
     echo " compressed export of the File table"
-    psql --set ON_ERROR_STOP=1 -d ${db_name} $* -c "set work_mem='$WORKMEM';"'set enable_mergejoin to off ; set enable_hashjoin to off; copy (SELECT FileId, FileIndex, JobId, PathId, Filename.Name, DeltaSeq, MarkId, LStat, Md5 FROM File JOIN Filename USING (FilenameId)) TO STDOUT' | $COMP -1 -c > file1016.data
+    psql -q --set ON_ERROR_STOP=1 -d ${db_name} $* -c "set work_mem='$WORKMEM';"'set enable_mergejoin to off ; set enable_hashjoin to off; copy (SELECT FileId, FileIndex, JobId, PathId, Filename.Name, DeltaSeq, MarkId, LStat, Md5 FROM File JOIN Filename USING (FilenameId)) TO STDOUT' | $COMP -1 -c > file1016.data
     
     if [ $? -ne 0 ]; then
 	echo "Error while dumping file table to $PWD/file1016.data"
@@ -318,12 +318,12 @@ EOF
 	exit 1
     fi
 
-    echo "Loading the File table from $PWD/file.$$.data..."
+    echo "Loading the File table from $PWD/file1016.data..."
     # we do everything in the same commit to avoid creating WALs on this operation
     cat file1016.data | $COMP -d | psql --set ON_ERROR_STOP=1 -d ${db_name} $* -c "BEGIN; TRUNCATE File; COPY File FROM STDIN; set maintenance_work_mem='2000MB'; CREATE INDEX file_jpfid_idx on File (JobId, PathId, Filename text_pattern_ops); ALTER TABLE ONLY File ADD CONSTRAINT file_pkey PRIMARY KEY (FileId); COMMIT;"
     
     if [ $? -ne 0 ]; then
-	echo "Inserting File data from file.$$.data failed."
+	echo "Inserting File data from file1016.data failed."
 	exit 1
     fi