Re: backup and restore questions

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Sally Sally <dedeb17(at)hotmail(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: backup and restore questions
Date: 2004-02-19 18:48:50
Message-ID: Pine.LNX.4.33.0402191145000.7005-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 19 Feb 2004, Sally Sally wrote:

> I had a few questions concerning the backup/restore process for pg.
>  
> 1) Is it possible to dump data onto an existing database that contains data (assumning the schema of
> both are the same). Has anyone done this? I am thinking of this in order to expediate the data load
> process

I do it all the time. Note that if you have constraints that adding the
new data would violate, it's likely to not import anything.

> 2) I read that when dumping and restoring data the insert option is safer but slower than copy? Does
> anyone know from experience how much slower (especially for a database containing millions of
> records).

Depends, but usually about twice as slow to as much as ten times slower.
It isn't really any "safer" just more portable to other databases.

> 3) can pg_restore accept a file that is not archived like a zipped file or plain text file (file.gz
> or file)

yes, plain text is fine. to do a .gz file you might have to do a gunzip
first. I usually just stick to plain text.

> 4) Is the general practise to have one whole dump of a database or several separate dumps (by table
> etc...)?

It's normal to see a single large dump. Where I work we run >80 databases
(running on 7.2.x so no schemas) with each database belonging to a
particular application. I wrote a custom wrapper for pg_dump that acts
something like pg_dumpall but dumps each database to a seperate file.
Makes restoring one table or something like that for a single database
much easier when you don't have to slog though gigabytes of unrelated
data.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Keary Suska 2004-02-19 18:52:47 Re: Select for update, locks and transaction levels
Previous Message V i s h a l Kashyap @ [Sai Hertz And Control Systems] 2004-02-19 18:46:56 Re: backup and restore questions