Dump / restore question

From: Garo Hussenjian <garo(at)xapnet(dot)com>
To: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Dump / restore question
Date: 2002-12-31 05:44:34
Message-ID: BA366EC2.5FF6%garo@xapnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello all,

Happy New Year's Eve Eve!

I am curious if anyone knows offhand how to dump/restore a database without
indexes and how to dump/restore just the indexes without the database...

I am asking because it is taking many hours to restore a 115 Meg dump file
and I have to do it again tomorrow, while not having so many hours to do it!
I have only primary key constraints and several indexes, but no foreign key
constraints, so I'm mainly concerned with the indexes.

I tried "pg_restore --rearrange dump_file" but I get the error:

pg_restore: [archiver] input file does not appear to be a valid archive

Is this because I did not dump with the -F (format) option? Do I need to use
"pg_dump -F t" for tar format?

Any help will greatly improve my chances of enjoying the New Year
celebration having completed this task a little sooner!

Garo.

on 10/27/02 2:13 PM, Bruno Wolff III at bruno(at)wolff(dot)to wrote:

> On Sun, Oct 27, 2002 at 13:49:27 -0800,
> Garo Hussenjian <garo(at)xapnet(dot)com> wrote:
>> Hello,
>>
>> I have a dump file from "pg_dump dbname > dump_file" of about 115 Mb that
>> takes a few seconds to create and takes several hours to restore using "psql
>> dbname < dump_file".
>>
>> I can't imagine I'm doing this correctly! What am I missing?
>
> Enforcing constraints and updating indexes can take a lot of time.
>
> You might get a significant speed up by not creating indexes or enforcing
> constraints (foreign keys probably being the bigest worry) until after
> the data gets loaded.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

=-=-==-=-=-==

Xapnet Internet Solutions
1501 Powell St., Suite N
Emeryville, CA 94608

Tel - (510) 655-9771
Fax - (510) 655-9775
Web - http://www.xapnet.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2002-12-31 06:44:05 Re: Dump / restore question
Previous Message Tom Lane 2002-12-31 04:40:18 Re: RI Constraint display