Re: How to modify dump files created by pg_dump

From: 任洪彩 <qdurenhongcai(at)163(dot)com>
To: "Adrian Klaver" <adrian(dot)klaver(at)gmail(dot)com>
Cc: "rod(at)iol(dot)ie" <rod(at)iol(dot)ie>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, "hongcai(dot)ren(at)nsn(dot)com" <hongcai(dot)ren(at)nsn(dot)com>
Subject: Re: How to modify dump files created by pg_dump
Date: 2013-06-06 01:17:45
Message-ID: 3dbcd91d.12703.13f170f99e2.Coremail.qdurenhongcai@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hmm...It seem like a wonderful solution.
But, i can't change the way to restore.
For some reason, the way to restore as follows.
pg_restore -C -h xxx -p xxx -U xxx -d template1 -e -v xxx.pgdump

Does any one can give a clarification about whether the dump file support modify?
By the way, dump with these options..-b -o -Fc -Z 0...that i can't chage.

在 2013-06-06 08:30:44,"Adrian Klaver" <adrian(dot)klaver(at)gmail(dot)com> 写道:
>On 06/05/2013 05:20 AM, 私人邮箱 wrote:
>> no,I can't...
>>
>> Actually the dump file comes from another site...
>
>So use the -f option to pg_restore to save the custom format file to a
>text file. Edit the text file and then run using psql.
>
>Ex:
>
>pg_restore -C -f whatever_name.sql /root/horen/rnwdump/DBRNWHSB.pgdump
>
>Open whatever_name.sql
> Change the database name wherever needed.
>
>psql -h CFPU-0 -p 5433 -U_qnrnwdbman -d template1 -f whatever_name.sql
>
>>
>>
>> 在 2013-6-5,19:28,Raymond O'Donnell <rod(at)iol(dot)ie> 写道:
>>
>>> On 05/06/2013 03:02, 任洪彩 wrote:
>>>> Hi,
>>>> Yes, you are right.
>>>> But -d option not suitable for me. Because our flatform use -C option
>>>> and -d template1 option to create the database described in the dump
>>>> file to restore the dump file.
>>>>
>>>> The whole command like this:
>>>> # /opt/nokiasiemens/SS_Postgres/bin/pg_restore -C -h CFPU-0 -p 5433 -U
>>>> _qnrnwdbman -d template1 -e -v
>>>
>>> Hmmmm, OK. Could you rename the original database before dumping it, so
>>> that its name matches the new one?
>>>
>>> Ray.
>>>
>>>
>>>
>>> --
>>> Raymond O'Donnell :: Galway :: Ireland
>>> rod(at)iol(dot)ie
>>
>>
>>
>
>
>--
>Adrian Klaver
>adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2013-06-06 01:42:37 Re: Trouble with replication
Previous Message Adrian Klaver 2013-06-06 00:30:44 Re: How to modify dump files created by pg_dump