Re: Transfer db from one port to another - Mailing list pgsql-general

From Charles Clavadetscher
Subject Re: Transfer db from one port to another
Date
Msg-id 022d01d13d6c$15e2c340$41a849c0$@swisspug.org
Whole thread Raw
In response to Re: Transfer db from one port to another  (Killian Driscoll <killiandriscoll@gmail.com>)
List pgsql-general

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Killian Driscoll
Sent: Mittwoch, 23. Dezember 2015 11:19
To: John R Pierce <pierce@hogranch.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: [GENERAL] Transfer db from one port to another

 

On 23 December 2015 at 11:07, John R Pierce <pierce@hogranch.com> wrote:

On 12/23/2015 1:40 AM, Killian Driscoll wrote:

Try it with plain pg_dump.

pg_dump -h localhost -p 5432 -Fc <dbname> > dump.sql

pg_restore -h localhost -p 5532 dump.sql

 

I tried this, but nothing appears to happen when entering the commands. Attached is a screenshot of the shell window - what am I doing wrong?



those are system shell commands, not psql sql commands.      catch-22, in the windows environment, postgresql's command tools probably aren't in the path, so to execute the above commands try this...

    start -> run ->  CMD <enter>

(or, click on an 'Command Prompt' shortcut).

    C:\Users\YourName> path "c:\Program Files\PostgreSQL\9.4\bin";%path%
    C:\Users\YourName> pg_dump -Fc -p 5432 <dbname> | pg_restore -p 5532

Thanks. When I do this I get an error: could not find a "pg_dump" to execute - I've used the path "C:\Program Files\PostgreSQL\9.3\bin";%path% which appears to be correct

 

      You may try calling the app without setting the path first or check the location browsing the file system:

      C:\Program Files\PostgreSQL\9.3\bin\ pg_dump -Fc -p 5432 <dbname>

 

      Don’t forget to replace <dbname> with the database that you want to dump.



if your postgres is installed somewhere else, replace "c:\Program Files\PostgreSQL\9.4\bin" in the PATH command with its actual location \bin  ....






-- 
john r pierce, recycling bits in santa cruz

 

pgsql-general by date:

Previous
From: Killian Driscoll
Date:
Subject: Re: Transfer db from one port to another
Next
From: Killian Driscoll
Date:
Subject: Re: Transfer db from one port to another