What's the correct way to copy entire database (its structure and data) to a new one in pgAdmin?
Postgresql – Creating a copy of a database in PostgreSQL
postgresql
Related Topic
- Postgresql – Copying PostgreSQL database to another server
- Sql – Save PL/pgSQL output from PostgreSQL to a CSV file
- Postgresql – How to drop all the tables in a PostgreSQL database
- Postgresql – Import SQL dump into PostgreSQL database
- Postgresql – How to exit from PostgreSQL command line utility: psql
- Postgresql – How to change PostgreSQL user password
- Postgresql – Which version of PostgreSQL am I running
- Ruby-on-rails – Getting error: Peer authentication failed for user “postgres”, when trying to get pgsql working with rails
Best Answer
Postgres allows the use of any existing database on the server as a template when creating a new database. I'm not sure whether pgAdmin gives you the option on the create database dialog but you should be able to execute the following in a query window if it doesn't:
Still, you may get:
To disconnect all other users from the database, you can use this query: