3 # shell script to grant privileges to the bacula database
8 if $bindir/psql -f - -d bacula $* <<END-OF-DATA
13 grant all on unsavedfiles to ${USER};
14 grant all on basefiles to ${USER};
15 grant all on jobmedia to ${USER};
16 grant all on file to ${USER};
17 grant all on job to ${USER};
18 grant all on media to ${USER};
19 grant all on client to ${USER};
20 grant all on pool to ${USER};
21 grant all on fileset to ${USER};
22 grant all on path to ${USER};
23 grant all on filename to ${USER};
24 grant all on counters to ${USER};
25 grant all on version to ${USER};
26 grant all on cdimages to ${USER};
28 -- for sequences on those tables
30 grant select, update on filename_filenameid_seq to ${USER};
31 grant select, update on path_pathid_seq to ${USER};
32 grant select, update on fileset_filesetid_seq to ${USER};
33 grant select, update on pool_poolid_seq to ${USER};
34 grant select, update on client_clientid_seq to ${USER};
35 grant select, update on media_mediaid_seq to ${USER};
36 grant select, update on job_jobid_seq to ${USER};
37 grant select, update on file_fileid_seq to ${USER};
38 grant select, update on jobmedia_jobmediaid_seq to ${USER};
39 grant select, update on basefiles_baseid_seq to ${USER};
43 echo "Privileges for ${USER} granted."
46 echo "Error creating privileges."