Re: [GENERAL] editing file after pg_dump

Поиск
Список
Период
Сортировка
От Ross J. Reedstrom
Тема Re: [GENERAL] editing file after pg_dump
Дата
Msg-id 36F15A70.5087BD2C@rice.edu
обсуждение исходный текст
Ответ на editing file after pg_dump  (Kevin Heflin <kheflin@shreve.net>)
Ответы Re: [GENERAL] editing file after pg_dump  (Kevin Heflin <kheflin@shreve.net>)
FATAL 1:btree: BTP_CHAIN flag was expected (vacuum command)  ("Jay W. Summet" <jay@summet.com>)
Список pgsql-general
Kevin Heflin wrote:
>
> I've run pg_dump on a database, which I've done many times before, to
> backup and then restore databases.
>
> However, this time before I restore the database, I'm wanting to edit one
> of the datatypes before I restore the data. As soon as I open up the file
> then save it, regardless of actually making any changes.. the restore will
> fail whenever it gets to the point of inserting the data.
>
> I'm guessing it's choking because whatever text editor I'm using is hosing
> the fields with long entries... I've tried opening the file with vi, pico,
> and Homesite on a WindowsNT box..
>
> Any suggestions on how to get around this?

you might try dumping the schema and data separately:

pg_dump -a yourdb >yourdb.data
pg_dump -s yourdb >yourdb.schema

then edit the schema without touching the data, then

psql newdb <yourdb.schema
psql newdb <yourdb.data


For speed, you may want to split the schema where the indeces are
created, and run that after the data load.

psql newdb <yourdb.schema.tables
psql newdb <yourdb.data
psql newdb <yourdb.schema.indices


HTH,

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St.,  Houston, TX 77005

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

Предыдущее
От: Tim Stoddard
Дата:
Сообщение: Vacuum
Следующее
От: Kevin Heflin
Дата:
Сообщение: Re: [GENERAL] editing file after pg_dump