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-5c9984e05c530365867958/] 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-5c9984e05da86616625578/] and even if your ssh connection uses a different port (1234) you are good to go: [crayon-5c9984e05da8d992124130/]

Read More