Re: How to modify dump files created by pg_dump - Mailing list pgsql-general

From Adrian Klaver
Subject Re: How to modify dump files created by pg_dump
Date
Msg-id 51AFD834.6010104@gmail.com
Whole thread Raw
In response to Re: How to modify dump files created by pg_dump  (私人邮箱 <qdurenhongcai@163.com>)
Responses Re: How to modify dump files created by pg_dump  (任洪彩 <qdurenhongcai@163.com>)
List pgsql-general
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@iol.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@iol.ie
>
>
>


--
Adrian Klaver
adrian.klaver@gmail.com


pgsql-general by date:

Previous
From: BladeOfLight16
Date:
Subject: Re: [postgis-users] point_ops with GiST PostGIS Spatial Index
Next
From: Michael Paquier
Date:
Subject: Re: Trouble with replication