在同一数据库中复制架构并创建具有不同名称的新架构 [英] Copy schema and create new schema with different name in the same data base

查看:68
本文介绍了在同一数据库中复制架构并创建具有不同名称的新架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种方法可以在Postgres的同一数据库中复制现有模式并使用其他名称生成新模式。

I there a way to copy the existing schema and generate new schema with another name in the same database in postgres.

推荐答案

使用pg_dump将当前模式转储到SQL格式的文件中。打开文件,用新名称替换模式名称,并在数据库中执行此脚本以创建新模式以及该模式内的所有其他对象。

Use pg_dump to dump your current schema in a SQL-formated file. Open the file, replace the schemaname with the new name and excute this script in your database to create the new schema and all other objects inside this schema.

这篇关于在同一数据库中复制架构并创建具有不同名称的新架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆