cant get pg_dump/pg_restore to behave

From: "Mike Frysinger" <vapier(dot)adi(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: cant get pg_dump/pg_restore to behave
Date: 2007-04-20 05:20:19
Message-ID: 8bd0f97a0704192220p3635677fo4245ca2fc93b38a3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

i'm trying to add the ability to dump our database as a backup in case
things go wrong with the db server, and so i'm trying to test things
now so that if/when things do go bad, i'm not scrambling then :)

as a test, i'm just trying to dump a database's schema and restore
that ... but it seems like pg_dump doesnt dump things in order so when
i restore the dump, i get bunches of errors about things not existing
... looking at the actual dump, i can see the tables pg_restore is
complaining about have operations run on it before the actual CREATE
sql ...

$ pg_dump -F c -s -d database-server mydb > mydb.schema
$ psql -d mydb < mydb.schema
<error about users_idx not existing>
$ grep users_idx mydb.schema
INSERT INTO users_idx (....
UPDATE users_idx SET ...
-- Name: users_idx; Type: TABLE; ...
CREATE TABLE users_idx (...

err, shouldnt that CREATE be first ?
-mike

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guy Rouillier 2007-04-20 05:37:30 Technical Documentation and Community Login
Previous Message Brent Wood 2007-04-20 03:58:43 Re: selective export for subsequent import (COPY)