pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonathan Gardner <jgardner@jonathangardner.net>
To: David A. Leedom <daleedom@hightowergroup.com>
To: pgsql-admin@postgresql.org
Subject: Re: Backup and Restore
Date: Thu, 5 Jun 2003 13:22:42 -0700
Message-ID: <200306051322.43748.jgardner@jonathangardner.net> (raw)
In-Reply-To: <5.2.0.9.0.20030605075052.028d9888@mail.hightowergroup.com>
References: <5.2.0.9.0.20030605075052.028d9888@mail.hightowergroup.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 05 June 2003 04:56, David A. Leedom wrote:
> I am using 7.2.x. When I run pg_dump on a database the objects are not
> loaded in the correct dependency order.
>
> Soooo.... when I run pg_restore it fails because objects that are needed
> have not been restored yet (ie.  trieds to restore a view that points to a
> table that has not yet been restored).  I then monkey around with the Table
> of Contents (TOC) and am able to get the restore to work.
>

Don't use pg_restore. Use psql. Note that pg_dump dumps a bunch of SQL 
commands.

This is also a cheap way to "vacuum" the database:

# pg_dump <dbname> | gzip > dump.gz
# dropdb <dbname>
# createdb <dbname>
# gunzip -c dump.gz > psql <dbname>

- -- 
Jonathan Gardner <jgardner@jonathangardner.net>
(was jgardn@alumni.washington.edu)
Live Free, Use Linux!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+36aSWgwF3QvpWNwRAveXAJ4qiMWs7bAsAQoQYmUb0j1bkYOrjwCgwVt6
Gkotl26Q7541ofhVDTP4lQk=
=U7V7
-----END PGP SIGNATURE-----



view thread (6+ messages)  latest in thread

Message-ID: <200306051322.43748.jgardner@jonathangardner.net>
Permalink:  ../200306051322.43748.jgardner@jonathangardner.net/
Also on:    postgresql.org/message-id/200306051322.43748.jgardner@jonathangardner.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: jgardner@jonathangardner.net, daleedom@hightowergroup.com
  Subject: Re: Backup and Restore
  In-Reply-To: <200306051322.43748.jgardner@jonathangardner.net>
  References: <5.2.0.9.0.20030605075052.028d9888@mail.hightowergroup.com> <200306051322.43748.jgardner@jonathangardner.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox