Skip site navigation (1) Skip section navigation (2)

Re: Backups

From: Nilesh Govindarajan <lists(at)itech7(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Backups
Date: 2010-02-21 01:57:28
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
On 02/20/2010 11:23 PM, Scott Marlowe wrote:
> On Sat, Feb 20, 2010 at 10:11 AM, Nilesh Govindarajan<lists(at)itech7(dot)com>  wrote:
>> I want a script to backup all databases table by table in different .sql
>> files.
> Why?  It may be that pg_dump / pg_restore already provide the
> functionality you are looking for.
>> How to do this ?
> pg_dump -t tablename dbname
> rinse repeat
>> Also since it is a script, there has to be some role having read access to
>> all tables on all databases. How to grant that ?
> Can they just be a superuser?  Or can you grant them the role that has
> ownership of the tables?

I don't feel safe to key in the root password in the script.

I was previously using MySQL, in which I had a user called backup 
without password having SELECT access on all tables and databases.

I need something similar in PgSQL. A possible solution seems to me is to 
use the trust auth for a user in pg_hba.conf, but if the user is given 
superuser status, then it will have write access to all databases, which 
is extremely dangerous.

Nilesh Govindarajan
Site & Server Adminstrator

In response to

  • Re: Backups at 2010-02-20 17:53:37 from Scott Marlowe


  • Re: Backups at 2010-02-21 02:33:42 from Scott Marlowe

pgsql-admin by date

Next:From: Kevin GrittnerDate: 2010-02-21 01:59:36
Subject: Re: pg_dump/restore problems
Previous:From: Greg StarkDate: 2010-02-20 23:22:07
Subject: Re: upgrading, but learned about pg_dumpall too late

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group