在Postgres中将表从一个数据库复制到另一个数据库 [英] Copy a table from one database to another in Postgres

查看:3049
本文介绍了在Postgres中将表从一个数据库复制到另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Postgres中将整个表从一个数据库复制到另一个数据库。任何建议?

I am trying to copy an entire table from one database to another in Postgres. Any suggestions?

推荐答案

提取表格并将其直接传递到目标数据库:

Extract the table and pipe it directly to the target database:

pg_dump -t table_to_copy source_db | psql target_db

这篇关于在Postgres中将表从一个数据库复制到另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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