Hello development,

I was trying to update tables over command 
update_postgresql_tables_10_to_11.in
and found error:
[test@localhost ~]$ 
/usr/share/doc/bacula-director-5.2.12/updatedb/update_postgresql_tables_10_to_11

This script will update a Bacula PostgreSQL database from version 10 to 11
  which is needed to convert from Bacula version 2.0.0 to 3.0.x or higher

psql: FATAL:  role "test" does not exist
/usr/share/doc/bacula-director-5.2.12/updatedb/update_postgresql_tables_10_to_11:
 
line 37: syntax error near unexpected token `then'
/usr/share/doc/bacula-director-5.2.12/updatedb/update_postgresql_tables_10_to_11:
 
line 37: `then'
[test@localhost ~]$

Here is proposed patch is:
diff --git a/bacula/updatedb/update_postgresql_tables_10_to_11.in 
b/bacula/updatedb/update_postgresql_tables_10_to_11.in
index f5df19f..1be8033 100644
--- a/bacula/updatedb/update_postgresql_tables_10_to_11.in
+++ b/bacula/updatedb/update_postgresql_tables_10_to_11.in
@@ -10,7 +10,7 @@ bindir=@POSTGRESQL_BINDIR@
  PATH="$bindir:$PATH"
  db_name=${db_name:-@db_name@}

-psql -f - -d ${db_name} $* <<END-OF-DATA
+if psql -f - -d ${db_name} $* <<END-OF-DATA
  -- The alter table operation can be faster with a big maintenance_work_mem
  -- Uncomment and adapt this value to your environment
  -- SET maintenance_work_mem = '1GB';


-- 
S pozdravem / Best regards

Petr Hracek

Red Hat Czech s.r.o.
BaseOS Core Services Brno

Email: phra...@redhat.com
Web: www.cz.redhat.com


------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Bacula-devel mailing list
Bacula-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to