【发布时间】:2018-03-24 04:49:11
【问题描述】:
我想将一组表从一个模式复制到同一数据库上的另一个模式。我在 Ubuntu 上使用 postgres v9,我们使用 Liquibase 对我们的数据库进行任何更改。
我可以使用类似于下面的代码创建新表,但我需要将新表创建为select * from another table
<changeSet author="jDoe" id="1">
<createTable tableName="abcproxy">
<column name="errtime" type="datetime">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="errmsg" type="varchar(255)">
<constraints nullable="false"/>
</column>
<column name="version" type="integer">
<constraints nullable="false"/>
</column>
</createTable>
我知道我们可以通过here 中提到的 sql 来做到这一点,但我想通过 Liquibase XML 配置来做到这一点。此外,如果我们可以使用 liquibase 配置复制授权/权限,那就太好了。
我可以按照here 所述尝试移动表格,但到目前为止,我的要求是复制而不是移动表格。
请让我知道实现相同目标的任何建议。谢谢。
【问题讨论】:
-
有什么建议吗?
-
你可以使用
select * from another table -
让我试试这个。谢谢!
标签: database postgresql liquibase