I have postgres 9.3 being installed with my windows desktop app on computers all over the place. I don't want Joe Script-kiddy looking at the pgpass.conf, getting the postgres password a running amuck in my Database.
I was able to to make a backup role using this article but I ran out of luck with reindexdb and Vacuum Analyze.
So far my solution is to write an application that will take an encrypted vbscript file and use ado to connect and run.
I've read over the PG help on grant and role and I just can't see how to do this. I'd appreciate any ideas.
Neil McGuigan suggestion worked for reindex and analyze. I need to reindex each table in a loop though. If I try just to reindex database myDb I get EINDEX DATABASE cannot be executed from a function or multi-command string. I get the same error with vacuum [table]
I'm still playing around with dblink as a possible solution. .. Well I can't use dblink because it wants the password so I'd have to code the password into the function and since my backup role has select it can view the contents of the function.
So I've got a low privileged role, backup, that can backup, analyze and reindex but cannot vacuum. seems strange to me.