Automated restore? - Mailing list pgsql-novice

From Paul Makepeace
Subject Automated restore?
Date
Msg-id 20030414142246.GA3917@mythix.realprogrammers.com
Whole thread Raw
Responses Re: Automated restore?  ("A.Bhuvaneswaran" <bhuvansql@myrealbox.com>)
List pgsql-novice
Hi,

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@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 ....................................... http://paulm.com/

"What is the sun's temperature? Life is a tasty cereal."
   -- http://paulm.com/toys/surrealism/


pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: search_path in SQL script?
Next
From: Danny Aldham
Date:
Subject: What version am I running?