Re: copy/backup database - Mailing list pgsql-general

From Doug McNaught
Subject Re: copy/backup database
Date
Msg-id m366e0pibv.fsf@belphigor.mcnaught.org
Whole thread Raw
In response to copy/backup database  ("Dan" <dan@NOSPAMbluecap.co.uk>)
List pgsql-general
"Dan" <dan@NOSPAMbluecap.co.uk> writes:

> Hello,
>
> I have a pgsql database I want to make a copy of to do some test work on it.
> In /var/lib/psql/data/base I have made a copy of this directory with correct
> file permission etc but when I try to access the database it says it's not
> in the catalogue.  I guess there's obviously a procudure for this or a pgsql
> command but I dont know what.

Don't do it that way.

$ pg_dump original_db > dump.out
$ createdb test_db
$ psql -f dump.out test_db

-Doug
--
The rain man gave me two cures; he said jump right in,
The first was Texas medicine--the second was just railroad gin,
And like a fool I mixed them, and it strangled up my mind,
Now people just get uglier, and I got no sense of time...          --Dylan

pgsql-general by date:

Previous
From: Jonathan Bartlett
Date:
Subject: Re: Oracle news article
Next
From: Bruno Wolff III
Date:
Subject: Re: [SQL] ORDER BY what?