Re: Restore to a database with another name?

From: phil campaigne <pcampaigne(at)charter(dot)net>
To: Lonni J Friedman <netllama(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Restore to a database with another name?
Date: 2005-03-30 21:24:54
Message-ID: 424B1926.7040002@charter.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Lonni J Friedman wrote:

>On Wed, 30 Mar 2005 15:58:02 -0500, phil campaigne
><pcampaigne(at)charter(dot)net> wrote:
>
>
>>Scott Marlowe wrote:
>>
>>
>>
>>>On Wed, 2005-03-30 at 14:28, phil campaigne wrote:
>>>
>>>
>>>
>>>
>>>>Hi All,
>>>>I want to move my development database (7.2.3) to my production server
>>>>but the production server database has a different name.
>>>>What is the procedure for restoring a database pg_dump to another
>>>>machine with a different database name?
>>>>
>>>>
>>>>
>>>>
>>>pg_dump -h source_host source_dbname |psql -h dest_host dest_dbname
>>>
>>>
>>>
>>>
>>>
>>Hi Scott,
>>Unfortunately my production machine is remote and I must transfer it via
>>FTP. How would that change your suggestion?
>>
>>
>
>You break it into two separate commands at the pipe, and use
>pg_restore to import it back in on the target box.
>
>
>
>
Lonni,
Before I try that, I should tell you that I used pg_dump to create the
backup. I read in the manual that psql client restores text files from
pg_dump. Should I still try pg_restore?
thanks,
Phil

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Lonni J Friedman 2005-03-30 21:27:18 Re: Restore to a database with another name?
Previous Message frank 2005-03-30 20:59:52 Re: Debugging deadlocks