PostgreSQL how to create a copy of a database or schema?

前端 未结 5 861
旧时难觅i
旧时难觅i 2020-12-08 04:48

Is there a simple way to create a copy of a database or schema in PostgreSQL 8.1?

I\'m testing some software which does a lot of updates to a particular schema withi

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 04:54

    If it's on the same server, you just use the CREATE DATABASE command with the TEMPLATE parameter. For example:

    CREATE DATABASE newdb WITH TEMPLATE olddb;
    

提交回复
热议问题