cant get pg_dump/pg_restore to behave

Поиск
Список
Период
Сортировка
От Mike Frysinger
Тема cant get pg_dump/pg_restore to behave
Дата
Msg-id 8bd0f97a0704192220p3635677fo4245ca2fc93b38a3@mail.gmail.com
обсуждение исходный текст
Ответы Re: cant get pg_dump/pg_restore to behave
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Brent Wood
Дата:
Сообщение: Re: selective export for subsequent import (COPY)
Следующее
От: Guy Rouillier
Дата:
Сообщение: Technical Documentation and Community Login