How to modify dump files created by pg_dump

From: 任洪彩 <qdurenhongcai(at)163(dot)com>
To: pgsql-sql(at)postgresql(dot)org, pgsql-general(at)postgresql(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org, hongcai(dot)ren(at)nsn(dot)com
Subject: How to modify dump files created by pg_dump
Date: 2013-06-04 08:44:35
Message-ID: 12ac78e3.24c17.13f0e5bf70d.Coremail.qdurenhongcai@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, guys

I have met a problem that do confused me.

I created a dump file by pg_dump from database named "DBRNWHSB" with parameters -b -o -Fc -Z 0.
As you know, at the beginning of the dump file contains some SQL statements for create the database "DBRNWHSB".

So here comes the question, I want let these SQL statements to create another database, e.g. named "myDB". In that case, when restore the dump i can restore the modified dump file with "-C" that "myDB" can be founded.

I have tried to modify the dump file manually. But the dump file may caused invalid.

# /opt/nokiasiemens/SS_Postgres/bin/pg_restore -C -h CFPU-0 -p 5433 -U _qnrnwdbman -d template1 -e -v /root/horen/rnwdump/DBRNWHSB.pgdump
pg_restore: connecting to database for restore
pg_restore: implied data-only restore

I wonder is there any way to modify the dump file after create or i can specify the database name when dump?

Best wishes.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Melvin Call 2013-06-04 12:32:45 Re: Passing a WHERE clause by trigger to a function
Previous Message Amit Langote 2013-06-04 03:27:07 Re: More buffers used than a relation's relpages