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

Automated restore?

From: Paul Makepeace <postgresql(dot)org(at)paulm(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Automated restore?
Date: 2003-04-14 14:22:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

I'd like to have a simple system whereby I can sync a local copy of a
whole database from the master.

My first shot at this has been,

ssh root(at)master "pg_dump -c $DATABASE" | sudo -u postgres psql -q $DATABASE

where postgres is the Debian user that has what I understand to be
super-user style privs with PostgreSQL.

The problem is that the dump contains \connect commands which require me
to either authenticate or create *nix users and run ident - as far as I
can tell. Ideally I'd like the super-user to be able to perform these
connects silently - the initial authentication effectively happening at
sudo time.

(My pg_hba.conf has localhost password authenticating so the webserver
can access it, and ident/username based for unix sockets.)

Is this possible? Is there a better way of doing what I'm trying?

If I've missed R'ing something in TFM, pointers appreciated! I didn't
see anything in the Admin Guide.

Thanks, Paul

Paul Makepeace .......................................

"What is the sun's temperature? Life is a tasty cereal."


pgsql-novice by date

Next:From: Adam WitneyDate: 2003-04-14 16:06:00
Subject: Re: What version am I running?
Previous:From: Tom LaneDate: 2003-04-14 03:36:07
Subject: Re: search_path in SQL script?

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