Copying data from one postgres db to another

1 year ago 14
YOUR AD HERE

I want to copy data from one PG database to another, without moving the data to my local and back to the db -

pg_dump -U postgres source_db_name | psql -U postgres target_db_name

pretty certain this pipe is moving the data across the network, to my machine and back - I am wondering if there is something I can do more akin to this with a shell session:

postgres=> cp -U postgres -S source_db_name -T target_db_name

obviously the above command is ficticious

is there any such way?

The views expressed on this page by users and staff are their own, not those of NamePros.

Read Entire Article