3 # shell script to grant privileges to the bacula database
9 if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
14 grant all on unsavedfiles to ${USER};
15 grant all on basefiles to ${USER};
16 grant all on jobmedia to ${USER};
17 grant all on file to ${USER};
18 grant all on job to ${USER};
19 grant all on media to ${USER};
20 grant all on client to ${USER};
21 grant all on pool to ${USER};
22 grant all on fileset to ${USER};
23 grant all on path to ${USER};
24 grant all on filename to ${USER};
25 grant all on counters to ${USER};
26 grant all on version to ${USER};
27 grant all on cdimages to ${USER};
28 grant all on mediatype to ${USER};
29 grant all on storage to ${USER};
30 grant all on device to ${USER};
31 grant all on status to ${USER};
32 grant all on location to ${USER};
33 grant all on locationlog to ${USER};
34 grant all on log to ${USER};
36 -- for sequences on those tables
38 grant select, update on filename_filenameid_seq to ${USER};
39 grant select, update on path_pathid_seq to ${USER};
40 grant select, update on fileset_filesetid_seq to ${USER};
41 grant select, update on pool_poolid_seq to ${USER};
42 grant select, update on client_clientid_seq to ${USER};
43 grant select, update on media_mediaid_seq to ${USER};
44 grant select, update on job_jobid_seq to ${USER};
45 grant select, update on file_fileid_seq to ${USER};
46 grant select, update on jobmedia_jobmediaid_seq to ${USER};
47 grant select, update on basefiles_baseid_seq to ${USER};
48 grant select, update on storage_storageid_seq to ${USER};
49 grant select, update on mediatype_mediatypeid_seq to ${USER};
50 grant select, update on device_deviceid_seq to ${USER};
51 grant select, update on location_locationid_seq to ${USER};
52 grant select, update on locationlog_loclogid_seq to ${USER};
53 grant select, update on log_logid_seq to ${USER};
57 echo "Privileges for ${USER} granted on ${db_name}."
60 echo "Error creating privileges."