I'm getting an PGSQL error each time I attempt to dump bacula to a SQL file
during catalog backup as follows:

[EMAIL PROTECTED]:/usr/local/share/bacula#
/usr/local/share/bacula/make_catalog_backup1 bacula bacula
pg_dump: attempt to lock table "location" failed: ERROR:  permission denied
for relation location
[EMAIL PROTECTED]:/usr/local/share/bacula# psql -Ubacula bacula
Welcome to psql 7.4.14, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

bacula=> \q
[EMAIL PROTECTED]:/usr/local/share/bacula#


Content of ./make_catalog_backup1 (only difference is the location of the
bacula sql table):
#!/bin/sh
#
# This script dumps your Bacula catalog in ASCII format
# It works for MySQL, SQLite, and PostgreSQL
#
#  $1 is the name of the database to be backed up and the name
#     of the output file (default = bacula).
#  $2 is the user name with which to access the database
#     (default = bacula).
#  $3 is the password with which to access the database or "" if no password
#     (default "")
#
#
BINDIR=/usr/local/bin

# cd /var/db/bacula
cd /usr/local/pgsql/bacula
rm -f bacula.sql
if test xsqlite = xpostgresql ; then
  echo ".dump" | ${BINDIR}/sqlite $1.db >$1.sql
else
  if test xmysql = xpostgresql ; then
    if test $# -gt 2; then
      MYSQLPASSWORD=" --password=$3"
    else
      MYSQLPASSWORD=""
    fi
    ${BINDIR}/mysqldump -u $2$MYSQLPASSWORD -f --opt $1 >$1.sql
  else                        
    if test xpostgresql = xpostgresql ; then
      if test $# -gt 2; then
        PGPASSWORD=$3
        export PGPASSWORD
      fi
      exec ${BINDIR}/pg_dump -c -U $2 $1 >$1.sql
    else
      echo ".dump" | ${BINDIR}/sqlite3 $1.db >$1.sql
    fi
  fi
fi
#
#  To read back a MySQL database use: 
#     cd /var/db/bacula
#     rm -f ${BINDIR}/../var/bacula/*
#     mysql <bacula.sql
#
#  To read back a SQLite database use:
#     cd /var/db/bacula
#     rm -f bacula.db
#     sqlite bacula.db <bacula.sql
#
#  To read back a PostgreSQL database use:
#     cd /var/db/bacula
#     dropdb bacula
#     createdb bacula
#     psql bacula <bacula.sql
#


I've run the following:

./update_bacula_tables
./update_postgresql_tables
./grant_bacula_privileges
./grant_postgresql_privileges

 to no avail. I'm no PGSQL expert...

~Doug 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to