On 15 Aug 2007 at 18:27, Tod Hagan wrote: > All, > > I encountered errors from the update_postgresql_tables script in 2.0.3 > when converting an old 1.38.8 postgresql database: > > > sudo /etc/bacula/update_bacula_tables -h node002 > Password: > Altering PostgreSQL tables > > This script will update a Bacula PostgreSQL database from version 9 > to 10 > which is needed to convert from Bacula version 1.38.x to 2.0.0 or > higher > Depending on the size of your database, > this script may take several minutes to run. > > psql:<stdin>:2: ERROR: must be owner of relation media > psql:<stdin>:3: ERROR: column "deviceid" of relation "media" does > not exist > psql:<stdin>:4: ERROR: must be owner of relation media > psql:<stdin>:5: ERROR: column "mediatypeid" of relation "media" does > not exist > psql:<stdin>:6: ERROR: must be owner of relation media > psql:<stdin>:7: ERROR: column "locationid" of relation "media" does > not exist > psql:<stdin>:8: ERROR: must be owner of relation media > psql:<stdin>:9: ERROR: column "recyclecount" of relation "media" > does not exist > psql:<stdin>:10: ERROR: must be owner of relation media > psql:<stdin>:11: ERROR: must be owner of relation media > psql:<stdin>:12: ERROR: column "scratchpoolid" of relation "media" > does not exist > psql:<stdin>:13: ERROR: must be owner of relation media > psql:<stdin>:14: ERROR: column "recyclepoolid" of relation "media" > does not exist > psql:<stdin>:15: ERROR: must be owner of relation media > psql:<stdin>:16: ERROR: column "enabled" of relation "media" does > not exist > psql:<stdin>:17: ERROR: must be owner of relation media > psql:<stdin>:19: ERROR: must be owner of relation job > psql:<stdin>:20: ERROR: must be owner of relation job > psql:<stdin>:21: ERROR: column "priorjobid" of relation "job" does > not exist > psql:<stdin>:23: ERROR: must be owner of relation jobmedia > psql:<stdin>:31: NOTICE: CREATE TABLE will create implicit sequence > "location_locationid_seq" for serial column "location.locationid" > psql:<stdin>:31: NOTICE: CREATE TABLE / PRIMARY KEY will create > implicit index "location_pkey" for table "location" > CREATE TABLE > psql:<stdin>:45: NOTICE: CREATE TABLE will create implicit sequence > "locationlog_loclogid_seq" for serial column "locationlog.loclogid" > psql:<stdin>:45: NOTICE: CREATE TABLE / PRIMARY KEY will create > implicit index "locationlog_pkey" for table "locationlog" > CREATE TABLE > psql:<stdin>:55: NOTICE: CREATE TABLE will create implicit sequence > "log_logid_seq" for serial column "log.logid" > psql:<stdin>:55: NOTICE: CREATE TABLE / PRIMARY KEY will create > implicit index "log_pkey" for table "log" > CREATE TABLE > CREATE INDEX > psql:<stdin>:59: ERROR: permission denied for relation version > psql:<stdin>:60: ERROR: permission denied for relation version > psql:<stdin>:62: WARNING: skipping "pg_authid" --- only table or > database owner can vacuum it > psql:<stdin>:62: WARNING: skipping "pg_tablespace" --- only table or > database owner can vacuum it > psql:<stdin>:62: WARNING: skipping "pg_pltemplate" --- only table or > database owner can vacuum it > psql:<stdin>:62: WARNING: skipping "pg_shdepend" --- only table or > database owner can vacuum it > psql:<stdin>:62: WARNING: skipping "pg_auth_members" --- only table > or database owner can vacuum it > psql:<stdin>:62: WARNING: skipping "pg_database" --- only table or > database owner can vacuum it > VACUUM > Update of Bacula PostgreSQL tables succeeded. > > Info about the postgresql users and databases: > > > sudo su postgres -c psql -l > Password: > Welcome to psql 8.1.9, the PostgreSQL interactive terminal. > > Type: \copyright for distribution terms > \h for help with SQL commands > \? for help with psql commands > \g or terminate with semicolon to execute query > \q to quit > > postgres=# \du > List of roles > Role name | Superuser | Create role | Create DB | Connections | > Member of > > -----------+-----------+-------------+-----------+-------------+----------- > bacula | no | no | yes | no limit | > postgres | yes | yes | yes | no limit | > root | no | no | yes | no limit | > (3 rows) > > postgres=# \q > > sudo psql -l > List of databases > Name | Owner | Encoding > -----------+----------+----------- > bacula | root | SQL_ASCII > postgres | postgres | UTF8 > template0 | postgres | UTF8 > template1 | postgres | UTF8 > (4 rows) > > Should update_bacula_tables be run while su'ed to the postgres user?
root is the owner of the bacula database. I created a bacula user for my database. I then run the upgrade scripts as bacula. In your case, you may have to be root, or perhaps postgres. Whatever works for you. -- Dan Langille - http://www.langille.org/ Available for hire: http://www.freebsddiary.org/dan_langille.php ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users