仅导出Postgres中的视图 [英] Export only views in Postgres

查看:113
本文介绍了仅导出Postgres中的视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法只能从Postgres模式中导出视图吗?

Is there any way to export only the views from a Postgres schema?

我正在使用Postgres 8.4。

I'm using Postgres 8.4.

谢谢。

推荐答案

如果每个视图都有特定前缀作为前缀,则可以使用以下命令:

If you have every view prefixed by certain prefix, you can use this command:

pg_dump -s -t 'prefix*' dbname > db.dump

或者您可以使用-t切换视图名称的位置...参见pg_dump的联机帮助页,最后是示例...

or you can use -t switch as many as possible with names of views... See manpage for pg_dump, on the end are examples...

这篇关于仅导出Postgres中的视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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