Re: [GENERAL] Creating a user for pg_start_backup

2015-07-27 Thread Stephen Frost
* Michael Paquier (michael.paqu...@gmail.com) wrote: > On Tue, Jul 21, 2015 at 4:47 PM, Andrew Beverley wrote: > > Dear all, > > > > I'm setting up hot backups on my database server. As such, I'd like to set > > up a > > Postgres user that has access to only pg_start_backup and pg_stop_backup. >

Re: [GENERAL] Creating a user for pg_start_backup

2015-07-21 Thread John R Pierce
On 7/21/2015 8:36 AM, Andrew Beverley wrote: Sorry to be dragging this off-topic, but what's the reason for using su instead of sudo? sudo is for non root users, it ends up running the su command. normally root doesn't use sudo at all, look at all the init.d scripts that run daemons as oth

Re: [GENERAL] Creating a user for pg_start_backup

2015-07-21 Thread Andrew Beverley
On Tue, 2015-07-21 at 03:00 -0700, John R Pierce wrote: > On 7/21/2015 1:51 AM, Andrew Beverley wrote: > > Thanks John. The backup script is running as root, so presumably I'd have > > to > > use > > sudo? Or should I run a separate cron job as postgres to do the above, and > > run > > the > >

Re: [GENERAL] Creating a user for pg_start_backup

2015-07-21 Thread Albe Laurenz
Andrew Beverley wrote: > I'm setting up hot backups on my database server. As such, I'd like to set up > a > Postgres user that has access to only pg_start_backup and pg_stop_backup. > > I'm unable to work out how to do this with the various GRANT options. Can > someone > point me in the right d

Re: [GENERAL] Creating a user for pg_start_backup

2015-07-21 Thread John R Pierce
On 7/21/2015 1:51 AM, Andrew Beverley wrote: Thanks John. The backup script is running as root, so presumably I'd have to use sudo? Or should I run a separate cron job as postgres to do the above, and run the backup script separately? those are both possibilities. I'd either use su (not sudo

Re: [GENERAL] Creating a user for pg_start_backup

2015-07-21 Thread Andrew Beverley
On Tue, 2015-07-21 at 01:46 -0700, John R Pierce wrote: > On 7/21/2015 1:31 AM, Andrew Beverley wrote: > > I had to specify a database name when connecting: > > > > psql -U backup -c "select pg_start_backup('Daily backup')" -d postgres > > psql defaults to the current user for both the datab

Re: [GENERAL] Creating a user for pg_start_backup

2015-07-21 Thread John R Pierce
On 7/21/2015 1:31 AM, Andrew Beverley wrote: I had to specify a database name when connecting: psql -U backup -c "select pg_start_backup('Daily backup')" -d postgres psql defaults to the current user for both the database name and user name. I probably would have run that psql command

Re: [GENERAL] Creating a user for pg_start_backup

2015-07-21 Thread Andrew Beverley
On Tue, 2015-07-21 at 16:54 +0900, Michael Paquier wrote: > On Tue, Jul 21, 2015 at 4:47 PM, Andrew Beverley wrote: > > Dear all, > > > > I'm setting up hot backups on my database server. As such, I'd like to set > > up a > > Postgres user that has access to only pg_start_backup and pg_stop_back

Re: [GENERAL] Creating a user for pg_start_backup

2015-07-21 Thread Michael Paquier
On Tue, Jul 21, 2015 at 4:47 PM, Andrew Beverley wrote: > Dear all, > > I'm setting up hot backups on my database server. As such, I'd like to set up > a > Postgres user that has access to only pg_start_backup and pg_stop_backup. > > I'm unable to work out how to do this with the various GRANT op

[GENERAL] Creating a user for pg_start_backup

2015-07-21 Thread Andrew Beverley
Dear all, I'm setting up hot backups on my database server. As such, I'd like to set up a Postgres user that has access to only pg_start_backup and pg_stop_backup. I'm unable to work out how to do this with the various GRANT options. Can someone point me in the right direction please? Or is ther