copy
- connection 있을때 안되서 pg_dump 이용이 편함
Drop
connect to that db
Postgresql - unable to drop database because of some auto connections to DB
In my case, I am using AWS Redshift (based on Postgres). And it appears there are no other connections to the DB, but I am getting this same error. ERROR: database "XYZ" is being accessed by other users In my case, it seems the database cluster is still doing some processing on the database, and while there are no other external/user connections, the database is still internally in use.
https://stackoverflow.com/questions/17449420/postgresql-unable-to-drop-database-because-of-some-auto-connections-to-db
PostgreSQL Copy Database Made Easy
Summary: in this tutorial, you will learn how to copy a PostgreSQL database on the same server or from a server to another. Sometimes, you want to copy a PostgreSQL database within a database server for testing purposes. PostgreSQL makes it easy to do it via the CREATE DATABASE statement as follows: This statement copies the sourcedb to the targetdb.
https://www.postgresqltutorial.com/postgresql-copy-database/

PostgreSQL CREATE DATABASE with Example
The syntax to create a database in PostgreSQL is CREATE DATABASE databasename
https://www.guru99.com/postgresql-create-database.html

PostgreSQL Copy Database Made Easy
Summary: in this tutorial, you will learn how to copy a PostgreSQL database on the same server or from a server to another. Sometimes, you want to copy a PostgreSQL database within a database server for testing purposes. PostgreSQL makes it easy to do it via the CREATE DATABASE statement as follows: This statement copies the sourcedb to the targetdb.
https://www.postgresqltutorial.com/postgresql-copy-database/


Seonglae Cho