Q:有的时候,需要到处特定的表的特定记录,而pg_dump只能导出指定的整个表或者整个数据库,怎么办呢?

A:利用select into语句创建一个临时表,然后使用pg_dump导出临时表。

例如:

select * into test_tbl from some_tbl where some_field > some_value;

pg_dump -d db_name -t test_tbl > /tmp/test.sql

/tmp/test.sql里面包含的,就是要求的特定记录了。
PostgreSQL | 评论(0) | 引用(0) | 阅读(21012)
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]