Postgres: Copy a database


November 17, 2012

Databases, Postgres

No Comment

For backup and development reasons a copy of a postgres database on the same system is often used. This is not a big problem and can be done directly as a SQL statement: [crayon-5ba2ac9a33255902049077/] in your favorite console (psql, pgadmin, etc). There is one thing to remember, if you do a template copy this can […]

Read More

Postgres: Remote copy a database between two machines using ssh

Sometimes it might be useful to copy a postgres database between two systems. This is not a big hazel and can be done with a simple one-liner (Port 22): [crayon-5ba2ac9a34bdb323404534/] and even if your ssh connection uses a different port (1234) you are good to go: [crayon-5ba2ac9a34be1513287405/]

Read More