Re: Creating a user for pg_start_backup - Mailing list pgsql-general

From Andrew Beverley
Subject Re: Creating a user for pg_start_backup
Date
Msg-id 1437468671.20338.20.camel@andybev.com
Whole thread Raw
In response to Re: Creating a user for pg_start_backup  (John R Pierce <pierce@hogranch.com>)
Responses Re: Creating a user for pg_start_backup  (John R Pierce <pierce@hogranch.com>)
List pgsql-general
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 database name and user
> name.   I probably would have run that psql command as the system
> postgres user and not specified any -U or -d ...

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?

Thanks,

Andy



pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: Creating a user for pg_start_backup
Next
From: John R Pierce
Date:
Subject: Re: Creating a user for pg_start_backup