Edit a dump file?

Поиск
Список
Период
Сортировка
Искать

Edit a dump file?

От:
Andreas Schlegel <schlegelaw@gmx.de>
Дата:
Hi,

I tried to restore an old database ( "pg_restore -d wh2 
wh2.pg_dump.20031011" ), but the restore  failed because of a broken 
relation.
The dump was created with "pg_dump -Ft wh2 | gzip > 
wh2.pg_dump.20031011.gz".

The message says: "pg_restore: [archiver (db)] could not execute query: 
ERROR:  Relation "tcompanystate" does not exist"
Indeed the table was dropped in the meantime and the view was obviously 
not corrcted.

My question is: is there change to edit the the dump and remove the 
view? I tried to open it with vi. I can read a bit but not all.

Greetings,
Andreas



Re: Edit a dump file?

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Andreas Schlegel  writes:
> My question is: is there change to edit the the dump and remove the 
> view? I tried to open it with vi. I can read a bit but not all.

You can do a selective restore by listing the dump's table of contents
into a file, editing the file, and then using it as a control file for
pg_restore.  See the pg_restore man page.

			regards, tom lane

Re: Edit a dump file?

От:
Andreas Schlegel <schlegelaw@gmx.de>
Дата:
Tom,

thanks for the tip. It's running now :-)

Greetings,
Andreas


Tom Lane wrote:

>Andreas Schlegel  writes:
>  
>
>>My question is: is there change to edit the the dump and remove the 
>>view? I tried to open it with vi. I can read a bit but not all.
>>    
>>
>
>You can do a selective restore by listing the dump's table of contents
>into a file, editing the file, and then using it as a control file for
>pg_restore.  See the pg_restore man page.
>
>			regards, tom lane
>
>
>  
>



FAQ